diff --git a/APSToolkitPython/setup.py b/APSToolkitPython/setup.py index 8596619..adc7368 100644 --- a/APSToolkitPython/setup.py +++ b/APSToolkitPython/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="aps-toolkit", - version="0.4.2", + version="0.4.4", author="chuong mep", author_email="chuongpqvn@gmail.com", description="A Toolkit Autodesk Platform Services for Python", diff --git a/APSToolkitPython/src/aps_toolkit/PropReader.py b/APSToolkitPython/src/aps_toolkit/PropReader.py index 626c2da..62e9c88 100644 --- a/APSToolkitPython/src/aps_toolkit/PropReader.py +++ b/APSToolkitPython/src/aps_toolkit/PropReader.py @@ -42,7 +42,10 @@ def __init__(self, urn, token, region="US", manifest_item: [ManifestItem] = None def _read_metadata(self): derivative = Derivative(self.urn, self.token, self.region) manifest_items = derivative.read_svf_manifest_items() - self._read_metadata_item(derivative, manifest_items[0]) + if len(manifest_items) > 0: + self._read_metadata_item(derivative, manifest_items[0]) + else: + raise Exception("No manifest item found") def _read_metadata_item(self, derivative, manifest_item): items = [ @@ -233,7 +236,7 @@ def get_recursive_ids_by_parameters(self, db_ids: List[int], params: List[str]) singleDF = pd.DataFrame(properties, index=[0]) dataframe = pd.concat([dataframe, singleDF], ignore_index=True) ids = self.get_children(id) - dataframe = pd.concat([dataframe, self.get_recursive_ids_by_parameters(ids,params)], ignore_index=True) + dataframe = pd.concat([dataframe, self.get_recursive_ids_by_parameters(ids, params)], ignore_index=True) if 'dbId' in dataframe.columns: dataframe = dataframe[['dbId'] + [col for col in dataframe.columns if col not in ['dbId']]] return dataframe diff --git a/APSToolkitPython/src/test/test_prop_reader.py b/APSToolkitPython/src/test/test_prop_reader.py index f50f12c..e086d88 100644 --- a/APSToolkitPython/src/test/test_prop_reader.py +++ b/APSToolkitPython/src/test/test_prop_reader.py @@ -6,7 +6,7 @@ class TestPropDbReader(TestCase): def setUp(self): - self.urn = "dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLm5KaEpjQkQ1UXd1bjlIV1ktNWViQmc_dmVyc2lvbj0x" + self.urn = "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Y2h1b25nX2J1Y2tldC9NeUhvdXNlLmlmYw" self.token = Auth().auth2leg() self.prop_reader = PropReader(self.urn, self.token)