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

Add ability to configure alembic_version table in DialectImpl #1563

Closed
wants to merge 2 commits into from

Conversation

maver1ck
Copy link
Contributor

Description

This is followup PR to discusion about custom alembic_version table definition
Reference: #1562
Fixes: #1560

Checklist

This pull request is:

  • A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • A short code fix
    • please include the issue number, and create an issue if none exists, which
      must include a complete example of the issue. one line code fixes without an
      issue and demonstration will not be accepted.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests. one line code fixes without tests will not be accepted.
  • A new feature implementation
    • please include the issue number, and create an issue if none exists, which must
      include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

@zzzeek
Copy link
Member

zzzeek commented Oct 31, 2024

ok, nice job with the test. I can clean that up to make it use a unique name

@zzzeek zzzeek requested a review from sqla-tester October 31, 2024 12:26
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 0dc0bda of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

New Gerrit review created for change 0dc0bda: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@maver1ck
Copy link
Contributor Author

maver1ck commented Oct 31, 2024

@zzzeek
I fixed linting issues and hopefully problem with sqla 1.3. (with_only_column is supported in 1.3)

@zzzeek zzzeek requested a review from sqla-tester October 31, 2024 13:09
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision e98a156 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset e98a156 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@CaselIT CaselIT requested a review from sqla-tester October 31, 2024 13:26
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 3ff240f of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset 3ff240f added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@maver1ck
Copy link
Contributor Author

maver1ck commented Oct 31, 2024

@zzzeek
I can't find a way of selecting one column that is both compatible with SQLAlchemy 1.3 and (1.4, 2.0).
Any ideas ?

My idea is to add condition on sqla_14 version.

@CaselIT
Copy link
Member

CaselIT commented Oct 31, 2024

There is a select you can use in the util sqla_compat module

@maver1ck
Copy link
Contributor Author

maver1ck commented Oct 31, 2024

@CaselIT
Fixed. May I ask for another test run ?

@maver1ck maver1ck requested a review from sqla-tester October 31, 2024 14:36
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

Hi, this is sqla-tester and I see you've pinged me for review. However, user maver1ck is not authorized to initiate CI jobs. Please wait for a project member to do this!

@CaselIT CaselIT requested a review from sqla-tester October 31, 2024 14:56
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 14539e4 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset 14539e4 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@CaselIT
Copy link
Member

CaselIT commented Oct 31, 2024

@CaselIT Fixed. May I ask for another test run ?

sure! thanks for the effort!

@CaselIT
Copy link
Member

CaselIT commented Oct 31, 2024

oh I guess since the last CI mypy was updated and you had to fix also mypy to make the ci pass.
Sorry about that.

Thanks and feel free to just tell us to complete this. making the CI happy can be tedious at times

@maver1ck
Copy link
Contributor Author

@CaselIT
No problem at all. I'm really missing bash script that will run all checks and tests :)

One more test please.

@CaselIT
Copy link
Member

CaselIT commented Oct 31, 2024

@CaselIT No problem at all. I'm really missing bash script that will run all checks and tests :)

One more test please.

there should be pre-commit configured that can run all tests

alembic/ddl/base.py Outdated Show resolved Hide resolved
alembic/ddl/impl.py Show resolved Hide resolved
alembic/runtime/migration.py Show resolved Hide resolved
@maver1ck
Copy link
Contributor Author

@CaselIT No problem at all. I'm really missing bash script that will run all checks and tests :)
One more test please.

there should be pre-commit configured that can run all tests

pre-commit is not triggering tests and mypy :(

@maver1ck maver1ck requested a review from zzzeek October 31, 2024 15:39
@maver1ck
Copy link
Contributor Author

@zzzeek
Please also find PR fixing mypy issues. #1564

@CaselIT
Copy link
Member

CaselIT commented Oct 31, 2024

@maver1ck can you rebase / merge main?

@maver1ck
Copy link
Contributor Author

@maver1ck can you rebase / merge main?

Rebased.

@CaselIT CaselIT requested a review from sqla-tester October 31, 2024 21:29
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision e70fdc8 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset e70fdc8 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

Copy link
Member

@zzzeek zzzeek left a comment

Choose a reason for hiding this comment

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

approved, we will add some final elements in the gerrit side thanks!

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

I've left a few comment, nothing major though.

Great work!

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

  • /COMMIT_MSG (line 18): we should add a line that says
Fixes: #1560
  • docs/build/unreleased/vers.rst (line 2): missing ticket here. also the file name could be named as the ticked.

Issue is 1560

alembic/ddl/impl.py Outdated Show resolved Hide resolved
alembic/ddl/impl.py Show resolved Hide resolved
@maver1ck
Copy link
Contributor Author

maver1ck commented Nov 1, 2024

@CaselIT
I fixed typing issues in the code however I don't know how to handle commit message and vers.rst file

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

Michael Bayer (zzzeek) wrote:

code review left on gerrit

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

  • docs/build/unreleased/vers.rst (line 2): i didnt realize we had a ticket for this

(that's how out of it I am)

"""create the Table object for the version_table.

Provided as part of impl so that third party dialects can override
this.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Michael Bayer (zzzeek) wrote:

im not convinced we need to bump here, but I guess numbers are free

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

Copy link
Collaborator

Choose a reason for hiding this comment

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

Michael Bayer (zzzeek) wrote:

Done

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

code review left on gerrit

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

  • docs/build/unreleased/vers.rst (line 2): I repurposed the one opened for the initial PR. Seemed like it fit

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

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

Michael Bayer (zzzeek) wrote:

code review left on gerrit

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

  • /COMMIT_MSG (line 18): Done
  • docs/build/unreleased/vers.rst (line 2): Done

@@ -136,6 +139,37 @@ def static_output(self, text: str) -> None:
self.output_buffer.write(text + "\n\n")
self.output_buffer.flush()

def version_table_impl(
self,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Michael Bayer (zzzeek) wrote:

Done

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@sqla-tester
Copy link
Collaborator

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556 has been merged. Congratulations! :)

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.

Make version table customizable by dialects
4 participants