Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot unpack non-iterable STACVersionRange object #338

Closed
sachinlionel opened this issue May 11, 2021 · 2 comments
Closed

cannot unpack non-iterable STACVersionRange object #338

sachinlionel opened this issue May 11, 2021 · 2 comments

Comments

@sachinlionel
Copy link

sachinlionel commented May 11, 2021

validate dict is throwing this error
TypeError: cannot unpack non-iterable STACVersionRange object
with stac_version='v1.0.0-rc.2' & stac_object_type=pystac.STACObjectType.ITEMCOLLECTION

code:

import json
import urllib.request  # the lib that handles the url stuff
from pystac.validation import validate_dict
import pystac

data = urllib.request.urlopen('https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/collection.json')
stac_dict = json.loads(data.read().decode())
validate_dict(stac_dict, stac_version='1.0.0-rc.4', stac_object_type=pystac.STACObjectType.ITEMCOLLECTION)

Stack trace:

Traceback (most recent call last):
  File "/Users/sachin/dev/unifi_virtenv3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3417, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-df8bf7d05ad0>", line 1, in <module>
    runfile('/Users/sachin/dev/next/robotframework/test_stac/py_stac.py', wdir='/Users/sachin/dev/next/robotframework')
  File "/Users/sachin/Library/Application Support/JetBrains/IntelliJIdea2020.2/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/Users/sachin/Library/Application Support/JetBrains/IntelliJIdea2020.2/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/sachin/dev/next/robotframework/test_stac/py_stac.py", line 13, in <module>
    validate_dict(stac_dict, stac_version='1.0.0-rc.4', stac_object_type=pystac.STACObjectType.ITEMCOLLECTION)
  File "/Users/sachin/dev/unifi_virtenv3/lib/python3.8/site-packages/pystac/validation/__init__.py", line 87, in validate_dict
    return RegisteredValidator.get_validator().validate(stac_dict, stac_object_type, stac_version,
  File "/Users/sachin/dev/unifi_virtenv3/lib/python3.8/site-packages/pystac/validation/stac_validator.py", line 79, in validate
    core_result = self.validate_core(json_dict, stac_object_type, stac_version, href)
  File "/Users/sachin/dev/unifi_virtenv3/lib/python3.8/site-packages/pystac/validation/stac_validator.py", line 167, in validate_core
    schema_uri = self.schema_uri_map.get_core_schema_uri(stac_object_type, stac_version)
  File "/Users/sachin/dev/unifi_virtenv3/lib/python3.8/site-packages/pystac/validation/schema_uri_map.py", line 185, in get_core_schema_uri
    for version_range, range_uri in self.DEFAULT_SCHEMA_MAP['core'][object_type][1]:
TypeError: cannot unpack non-iterable STACVersionRange object
@duckontheweb
Copy link
Contributor

Thanks for reporting @sachinlionel. Could you provide a full example that we could use to reproduce the problem, including the full error traceback? Thanks.

@gadomski
Copy link
Member

gadomski commented Nov 8, 2022

Without additional error information, and acknowledging that STACObjectType.ITEMCOLLECTION no longer exists (#430), I'm closing as not planned.

@gadomski gadomski closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants