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

Error when parsing, calling lower() to an int #97

Open
maxisch opened this issue Nov 2, 2022 · 1 comment
Open

Error when parsing, calling lower() to an int #97

maxisch opened this issue Nov 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@maxisch
Copy link

maxisch commented Nov 2, 2022

Describe the bug
On a few collections there is an issue when parsing it's traits. deadfellaz, cyberbrokers and more

Information

  • Collection link/name: deadfellaz or cyberbrokers
  • Contract standard: erc721
  • Chain: ethereum mainnet

To Reproduce
Steps to reproduce the behavior:
run: python3 -m scripts.score_real_collections deadfellaz

Expected behavior
Int traits should not be lowercased

Environment

  • OS: iOS
  • Python = 3.10.x
  • Library Version = 0.7.0b0

Additional context
Stacktrace:

python3 -m scripts.score_real_collections deadfellaz
Scoring collections: ['deadfellaz'] with use_cache=True
Output file prefix: score_real_collections_results with type .json
Generating results for: deadfellaz
No opensea cache file found for deadfellaz: cached_data/deadfellaz_cached_os_trait_data.json
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/scripts/score_real_collections.py", line 117, in <module>
    score_collection_and_output_results(
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/scripts/score_real_collections.py", line 47, in score_collection_and_output_results
    collection = get_collection_from_opensea(slug, use_cache=use_cache)
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/resolver/opensea_api_helpers.py", line 391, in get_collection_from_opensea
    tokens = get_all_collection_tokens(
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/resolver/opensea_api_helpers.py", line 206, in get_all_collection_tokens
    tokens_batch = get_tokens_from_opensea(
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/resolver/opensea_api_helpers.py", line 277, in get_tokens_from_opensea
    token_metadata = opensea_traits_to_token_metadata(asset_traits=asset["traits"])
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/resolver/opensea_api_helpers.py", line 145, in opensea_traits_to_token_metadata
    string_attr[trait["trait_type"]] = StringAttribute(
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/models/token_metadata.py", line 30, in __init__
    self.value = normalize_attribute_string(value)
  File "/Users/maximiliano/repos/pixel/localhost/open-rarity/open_rarity/models/utils/attribute_utils.py", line 17, in normalize_attribute_string
    return value.lower().strip()
AttributeError: 'int' object has no attribute 'lower'
@maxisch maxisch added the bug Something isn't working label Nov 2, 2022
@impreso
Copy link
Contributor

impreso commented Dec 3, 2022

We will fix this in 1.0.0 release, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants