diff --git a/pydtk/db/schemas/__init__.py b/pydtk/db/schemas/__init__.py index b989efa..77524ff 100644 --- a/pydtk/db/schemas/__init__.py +++ b/pydtk/db/schemas/__init__.py @@ -1,4 +1,5 @@ """Schemas.""" + import glob import importlib import inspect diff --git a/pydtk/db/v1/handlers/__init__.py b/pydtk/db/v1/handlers/__init__.py index 1dfc6f1..a008448 100644 --- a/pydtk/db/v1/handlers/__init__.py +++ b/pydtk/db/v1/handlers/__init__.py @@ -105,9 +105,11 @@ def _get_uuid_from_item(self, item): """ pre_hash = "".join( [ - "{:.09f}".format(item[c["name"]]) - if isinstance(item[c["name"]], float) - else str(item[c["name"]]) + ( + "{:.09f}".format(item[c["name"]]) + if isinstance(item[c["name"]], float) + else str(item[c["name"]]) + ) for c in self.columns if c["name"] in item.keys() ] diff --git a/pydtk/db/v2/handlers/__init__.py b/pydtk/db/v2/handlers/__init__.py index 0cdd0d3..35cff03 100644 --- a/pydtk/db/v2/handlers/__init__.py +++ b/pydtk/db/v2/handlers/__init__.py @@ -159,9 +159,7 @@ def _initialize_engine( engine = ( "postgresql" if engine == "timescaledb" - else "mysql" - if engine == "mariadb" - else engine + else "mysql" if engine == "mariadb" else engine ) username_and_password = ( "" @@ -214,9 +212,11 @@ def _get_uuid_from_item(self, data_in): pre_hash = "".join( [ - "{:.09f}".format(item[c["name"]]) - if isinstance(item[c["name"]], float) - else str(item[c["name"]]) + ( + "{:.09f}".format(item[c["name"]]) + if isinstance(item[c["name"]], float) + else str(item[c["name"]]) + ) for c in self.columns if c["name"] in item.keys() ] diff --git a/pydtk/db/v3/handlers/__init__.py b/pydtk/db/v3/handlers/__init__.py index a293b0d..a23180f 100644 --- a/pydtk/db/v3/handlers/__init__.py +++ b/pydtk/db/v3/handlers/__init__.py @@ -233,9 +233,11 @@ def _get_uuid_from_item(self, data_in): pre_hash = "".join( [ - "{:.09f}".format(item[column]) - if isinstance(item[column], float) - else str(item[column]) + ( + "{:.09f}".format(item[column]) + if isinstance(item[column], float) + else str(item[column]) + ) for column in hash_target_columns if column in item.keys() ] diff --git a/pydtk/db/v4/handlers/__init__.py b/pydtk/db/v4/handlers/__init__.py index 86287eb..2fa45ab 100644 --- a/pydtk/db/v4/handlers/__init__.py +++ b/pydtk/db/v4/handlers/__init__.py @@ -423,11 +423,15 @@ def _get_uuid_from_item(self, data_in): pre_hash = "".join( [ - "{:.09f}".format(item[column]) - if isinstance(item[column], float) - else str(item[column].keys()) - if isinstance(item[column], dict) - else str(item[column]) + ( + "{:.09f}".format(item[column]) + if isinstance(item[column], float) + else ( + str(item[column].keys()) + if isinstance(item[column], dict) + else str(item[column]) + ) + ) for column in hash_target_columns if column in item.keys() ] diff --git a/pydtk/models/__init__.py b/pydtk/models/__init__.py index fd4cc0f..b2887e1 100644 --- a/pydtk/models/__init__.py +++ b/pydtk/models/__init__.py @@ -133,9 +133,9 @@ def to_dict(self): elif isinstance(value, dict): result[attr] = dict( map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") - else item, + lambda item: ( + (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item + ), value.items(), ) ) @@ -527,9 +527,9 @@ def to_dict(self): elif isinstance(value, dict): result[attr] = dict( map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") - else item, + lambda item: ( + (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item + ), value.items(), ) ) diff --git a/pydtk/utils/imports.py b/pydtk/utils/imports.py index 0b9aeaa..b3c498f 100644 --- a/pydtk/utils/imports.py +++ b/pydtk/utils/imports.py @@ -1,6 +1,5 @@ """Import utilities.""" - import importlib import importlib.util