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

fix: Dataclass field type not used correctly #371

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

anthonyjgraff
Copy link
Contributor

@anthonyjgraff anthonyjgraff commented Sep 17, 2023

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
  • Pre-Commit Checks were ran and passed
  • Tests were ran and passed

Description

  • Get dataclass type information from field.type instead of using typing.get_type_hints

Close Issue(s)

@anthonyjgraff anthonyjgraff requested review from a team as code owners September 17, 2023 14:00
@anthonyjgraff
Copy link
Contributor Author

Any idea why this test would fail? I can't recreate the failure locally...

Maybe we got unlucky and added the same key to the dictionary twice?

@guacs
Copy link
Member

guacs commented Sep 17, 2023

Any idea why this test would fail? I can't recreate the failure locally...

Maybe we got unlucky and added the same key to the dictionary twice?

Ohhh this could very well be it. There's an issue #362, that's open regarding this. This has been happening for a while and for some reason I never realized that it could just be adding the same key twice.

@guacs
Copy link
Member

guacs commented Sep 17, 2023

@anthonyjgraff could you rebase from main? I've skipped that test for now.

Copy link
Member

@guacs guacs left a comment

Choose a reason for hiding this comment

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

Could you skip the sqlalchemy tests if the sqlalchemy is v1 since MappedAsDataclass is only available from v2 onwards?

pyproject.toml Outdated Show resolved Hide resolved
tests/test_dataclass_factory.py Outdated Show resolved Hide resolved
@guacs
Copy link
Member

guacs commented Sep 18, 2023

I just have that one doubt. Everything else looks great!

@guacs
Copy link
Member

guacs commented Sep 18, 2023

@all-contributors add @anthonyjgraff for code

@allcontributors
Copy link
Contributor

@guacs

I've put up a pull request to add @anthonyjgraff! 🎉

@guacs
Copy link
Member

guacs commented Sep 18, 2023

@anthonyjgraff could you rebase from main. I think you might have to undo almost all of what I mentioned regarding the setting of sqlalchemy dependency in pyproject.toml now that #369 is completed. Sorry about that.

@guacs guacs enabled auto-merge (squash) September 19, 2023 00:31
@cofin cofin disabled auto-merge September 19, 2023 00:55
@cofin cofin merged commit 87a6749 into litestar-org:main Sep 19, 2023
15 checks passed
guacs added a commit that referenced this pull request Sep 20, 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

Successfully merging this pull request may close these issues.

Bug: SQLAlchemy Mapped field type not used correctly
4 participants