Skip to content

Conversation

@TomAugspurger
Copy link
Collaborator

Related Issue(s): #

Closes #378

Description:

Fixed Asset construction in Collection.from_dict

PR Checklist:

  • Code is formatted (run scripts/format)
  • Tests pass (run scripts/test)
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

for asset_key, asset_dict in assets.items():
collection.add_asset(asset_key, Asset(asset_dict))
asset_dict = dict(asset_dict)
asset_dict.setdefault("media_type", asset_dict.pop("type", None))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll assume it's deliberate that we use media_type here instead of type. Anything else I should watch out for?

@duckontheweb
Copy link
Contributor

@TomAugspurger I think #373 may have also covered this, sorry for the overlap.

@TomAugspurger TomAugspurger deleted the fix/asset branch June 1, 2021 17:45
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

Successfully merging this pull request may close these issues.

Collection.from_file parses assets incorrectly

2 participants