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

feat(sqlalchemy): extend SQLAlchemy Plugin to include Alembic #2164

Closed
wants to merge 97 commits into from

Conversation

cofin
Copy link
Member

@cofin cofin commented Aug 13, 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

Description

Close Issue(s)

cofin and others added 30 commits July 25, 2023 08:39
* Support custom status code for openapi exceptions

* add docs for custom exceptions in OpenAPI schemas

---------

Co-authored-by: Na'aman Hirschfeld <[email protected]>
@cofin cofin requested a review from a team as a code owner August 27, 2023 02:44
@sonarcloud
Copy link

sonarcloud bot commented Aug 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

18.4% 18.4% Coverage
0.0% 0.0% Duplication

@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/2164

If neither plugin is found, it raises an ImproperlyConfiguredException.
"""
for type_ in SQLAlchemyPlugin, SQLAlchemyInitPlugin:
with suppress(KeyError):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
with suppress(KeyError):
if type_ in app.plugins:

Copy link
Member

Choose a reason for hiding this comment

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

Thinking if we should maybe add a different method to retrieve a plugin that might not exist / add a default of None to this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
with suppress(KeyError):
if type_ in app.plugins:

I think this does not exactly do what I intend to? It always seems to trigger ImproperlyConfiguredException

@Alc-Alc
Copy link
Contributor

Alc-Alc commented Aug 28, 2023

In commit cffc81b, the addition of _namespace_metadata=op._namespace_metadata to order_columns addresses the AttributeError: 'NoneType' object has no attribute 'schema' issue. This workaround will be necessary until the resolution of sqlalchemy/alembic issue #1193 to ensure that custom column sorting within CREATE TABLE works.

@cofin cofin closed this Sep 8, 2023
@cofin cofin deleted the sqlalchemy-alembic-cli branch September 8, 2023 15:09
@Faolain
Copy link

Faolain commented Sep 9, 2023

Is there any reason why this was closed and the branch deleted? It appears a significant amount of work was put into this and it was just about done unless I'm misunderstanding something here.

@Goldziher Goldziher restored the sqlalchemy-alembic-cli branch September 9, 2023 08:12
@Goldziher
Copy link
Contributor

@Faolain - cofin stepped down as maintainer. You can see the discussion in our discord server.

I restored the branch for now.

@provinzkraut provinzkraut deleted the sqlalchemy-alembic-cli branch September 16, 2023 13:54
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.

8 participants