Skip to content

Commit

Permalink
Fix legacy tabular schema Package initiation without a descriptor (#…
Browse files Browse the repository at this point in the history
…260)

* Added a failing test

* Fixed the bug
  • Loading branch information
roll committed Mar 27, 2020
1 parent c62a5bb commit e86789f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datapackage/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def __init__(self, descriptor=None, base_path=None, strict=False, storage=None,
schema = 'tabular-data-package'
elif schema == 'fiscal':
schema = 'fiscal-data-package'
if descriptor is None:
descriptor = {}
descriptor['profile'] = schema

# Handle deprecated default_base_path argument
Expand Down
5 changes: 5 additions & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,11 @@ def test_package_save_slugify_fk_resource_name_issue_181():
{'fields': 'lang', 'reference': {'resource': 'my_langs', 'fields': 'lang'}}
]


def test_package_legacy_schema_tabular_issue_197():
package = Package(None, schema='tabular')


# Fixtures

@pytest.fixture
Expand Down

0 comments on commit e86789f

Please sign in to comment.