diff --git a/pyproject.toml b/pyproject.toml index ac28730..e531391 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ requires-python = ">= 3.8" dependencies = [ "makefun", "SQLAlchemy-Utils", - "WuttJamaican[db]>=0.16.2", + "WuttJamaican[db]", ] diff --git a/src/wuttasync/cli/base.py b/src/wuttasync/cli/base.py index 008dd5b..c1fbd55 100644 --- a/src/wuttasync/cli/base.py +++ b/src/wuttasync/cli/base.py @@ -56,22 +56,25 @@ def importer_command_template( bool, typer.Option(help="Allow existing target records to be deleted.")] = False, - # fields - fields: Annotated[ - str, - typer.Option('--fields', - help="List of fields to process. See also --exclude.")] = None, - excluded_fields: Annotated[ - str, - typer.Option('--exclude', - help="List of fields *not* to process. See also --fields.")] = None, - # dry run? dry_run: Annotated[ bool, typer.Option('--dry-run', help="Go through the motions, but rollback the transaction.")] = False, + # # fields + # fields: Annotated[ + # str, + # typer.Option('--fields', + # help="List of fields to process. If specified, " + # "any field not listed is excluded regardless " + # "of --exclude.")] = None, + # exclude_fields: Annotated[ + # str, + # typer.Option('--exclude', + # help="List of fields not to process. If " + # "specified, any field not listed is (not?) included " + # "based on app logic and/or --fields.")] = None, ): """ Stub function which provides a common param signature; used with diff --git a/src/wuttasync/importing/base.py b/src/wuttasync/importing/base.py index d46ae67..164c04f 100644 --- a/src/wuttasync/importing/base.py +++ b/src/wuttasync/importing/base.py @@ -82,14 +82,6 @@ class Importer: overwrite this attribute directly, for dynamic fields. If so then ``get_fields()`` will return the new value. And really, it's probably just as safe to read this attribute directly too. - - .. attribute:: excluded_fields - - This attribute will often not exist, but is mentioned here for - reference. - - It may be specified via constructor param in which case each - field listed therein will be removed from :attr:`fields`. """ allow_create = True @@ -191,18 +183,6 @@ class Importer: self.supported_fields = self.get_supported_fields() self.fields = self.get_fields() - # fields could be comma-delimited string from cli param - if isinstance(self.fields, str): - self.fields = self.config.parse_list(self.fields) - - # discard any fields caller asked to exclude - excluded = getattr(self, 'excluded_fields', None) - if excluded: - if isinstance(excluded, str): - excluded = self.config.parse_list(excluded) - self.fields = [f for f in self.fields - if f not in excluded] - @property def orientation(self): """ diff --git a/tests/importing/test_base.py b/tests/importing/test_base.py index 0648dc9..abe121b 100644 --- a/tests/importing/test_base.py +++ b/tests/importing/test_base.py @@ -36,20 +36,6 @@ class TestImporter(DataTestCase): self.assertTrue(imp.delete) self.assertFalse(imp.dry_run) - def test_constructor_fields(self): - model = self.app.model - - # basic importer - imp = self.make_importer(model_class=model.Setting, fields='name') - self.assertEqual(imp.fields, ['name']) - - def test_constructor_excluded_fields(self): - model = self.app.model - - # basic importer - imp = self.make_importer(model_class=model.Setting, excluded_fields='value') - self.assertEqual(imp.fields, ['name']) - def test_get_model_title(self): model = self.app.model imp = self.make_importer(model_class=model.Setting)