Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dedupe/datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ def typify_variables(
variable_definitions: Iterable[VariableDefinition],
) -> tuple[list[FieldVariable], list[Variable]]:

variable_types = {variable.type: variable for variable in dedupe.variables.__all__}
variable_types = {}
for variablename in dedupe.variables.__all__:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you copied this from my PR, I'm not positive that all is actually the correct solution, perhaps I'm abusing it and it actually is intended for something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's intended use is to control the behavior of "import *" but i think this works fine.

variable = getattr(dedupe.variables, variablename)
variable_types[variable.type] = variable

plugin_vars = load_setuptools_entrypoints("dedupevariables")
for var in plugin_vars:
Expand Down
22 changes: 11 additions & 11 deletions dedupe/variables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
from dedupe.variables.string import ShortStringType, StringType, TextType

__all__ = [
CustomType,
CategoricalType,
ExactType,
ExistsType,
InteractionType,
LatLongType,
PriceType,
SetType,
ShortStringType,
StringType,
TextType,
"CustomType",
"CategoricalType",
"ExactType",
"ExistsType",
"InteractionType",
"LatLongType",
"PriceType",
"SetType",
"ShortStringType",
"StringType",
"TextType",
]