Skip to content

Commit

Permalink
fix urn bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Mar 22, 2024
1 parent 67bc715 commit 3375b22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion APSToolkitPython/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="aps-toolkit",
version="0.4.2",
version="0.4.4",
author="chuong mep",
author_email="[email protected]",
description="A Toolkit Autodesk Platform Services for Python",
Expand Down
7 changes: 5 additions & 2 deletions APSToolkitPython/src/aps_toolkit/PropReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion APSToolkitPython/src/test/test_prop_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3375b22

Please sign in to comment.