Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Adds deprecation note on function_modifiers_base
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Dec 24, 2022
1 parent 2da1fc0 commit a78ff0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions hamilton/function_modifiers_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Quick hack to make this a backwards compatible refactor
# This allows us to define everything within the function_modifiers directory, and just refer to that
# While maintaining old imports
import logging

from hamilton.function_modifiers.base import * # noqa F403

logger = logging.getLogger(__name__)
logger.warning(
"Import of this module is deprecated, and will be removed in a 2.0 release. In fact, "
"this is not a public-facing API, so if you're hitting this message either we're internally "
"importing the wrong one or you're doing something fancy. Either way, \n"
"please replace with `from hamilton.function_modifiers import base as fm_base`."
)
5 changes: 3 additions & 2 deletions hamilton/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from types import ModuleType
from typing import Any, Callable, Collection, Dict, List, Set, Tuple, Type

from hamilton import base, function_modifiers_base, node
from hamilton import base, node
from hamilton.function_modifiers import base as fm_base
from hamilton.graph_utils import find_functions
from hamilton.type_utils import types_match

Expand Down Expand Up @@ -67,7 +68,7 @@ def create_function_graph(

# create nodes -- easier to just create this in one loop
for func_name, f in functions:
for n in function_modifiers_base.resolve_nodes(f, config):
for n in fm_base.resolve_nodes(f, config):
if n.name in config:
continue # This makes sure we overwrite things if they're in the config...
if n.name in nodes:
Expand Down

0 comments on commit a78ff0c

Please sign in to comment.