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

Validation errors when creating collection #14

Closed
MTGguru opened this issue Dec 26, 2022 · 4 comments
Closed

Validation errors when creating collection #14

MTGguru opened this issue Dec 26, 2022 · 4 comments

Comments

@MTGguru
Copy link

MTGguru commented Dec 26, 2022

Hi,

I am getting the following error when attempting to create a collection. Please help!

C:\Users\OrcMa>mtg-ssm create collection.xlsx Retrieving https://api.scryfall.com/bulk-data Fetching https://api.scryfall.com/bulk-data Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\mtg-ssm.exe\__main__.py", line 7, in <module> File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 231, in main oracle = get_oracle(args.set_types, args.include_digital) File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 141, in get_oracle scrydata = fetcher.scryfetch() File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\scryfall\fetcher.py", line 118, in scryfetch bulk_list = ScryObjectList[ScryBulkData].parse_obj(bulk_json) File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj File "pydantic\main.py", line 342, in pydantic.main.BaseModel.__init__ pydantic.error_wrappers.ValidationError: 5 validation errors for ScryObjectList[ScryBulkData] data -> 0 -> compressed_size field required (type=value_error.missing) data -> 1 -> compressed_size field required (type=value_error.missing) data -> 2 -> compressed_size field required (type=value_error.missing) data -> 3 -> compressed_size field required (type=value_error.missing) data -> 4 -> compressed_size field required (type=value_error.missing)

@Bixxta
Copy link

Bixxta commented Dec 26, 2022

Hi,

I was also having this problem, and it looks like the culprit is a misnamed field in models.py - the field 'compressed_size' in ScryBulkData is just called "size" in Scryfall's API Documentation. Changing the field name from 'compressed_size' to 'size' fixes the issue for me.

@MTGguru
Copy link
Author

MTGguru commented Dec 29, 2022

@Bixxta Thank you! That worked!

@gwax
Copy link
Owner

gwax commented Jan 4, 2023

They removed the "compressed_size" field recently (it used to be there). I updated to handle the change a few days ago: 3bab6c0

Can you please update to version 2.3.1 and confirm whether or not it is still a problem?

@gwax
Copy link
Owner

gwax commented Feb 1, 2023

I believe this to be fixed. Please reopen if the issue is not sufficiently resolved in the current version of mtg-ssm.

@gwax gwax closed this as completed Feb 1, 2023
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