Skip to content

Upgrade SQLAlchemy to 2.0.2#86436

Merged
bdraco merged 34 commits into
devfrom
sql_alchemy_20
Feb 8, 2023
Merged

Upgrade SQLAlchemy to 2.0.2#86436
bdraco merged 34 commits into
devfrom
sql_alchemy_20

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

@emontnemery emontnemery commented Jan 23, 2023

Proposed change

Upgrade SQLAlchemy to 2.0.2

https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.2

A workaround added to the tests until a release with sqlalchemy-utils including kvesteri/sqlalchemy-utils#677 is available.

Production testing:

  • sqlite
  • MariaDB
  • postgresql

Performance testing

  • neutral or slightly faster

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (recorder) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of recorder can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign recorder Removes the current integration label and assignees on the issue, add the integration domain after the command.

@frenck frenck marked this pull request as draft January 23, 2023 08:54
@frenck
Copy link
Copy Markdown
Member

frenck commented Jan 23, 2023

Converted to draft, until SQLAlchemy 2.0.0 is released

Comment thread homeassistant/components/recorder/db_schema.py Outdated
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 30, 2023

Hmm.. tests are passing locally

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 31, 2023

postgresql looks good as well with the caveat that the dataset I'm using and the number of entities isn't as good as the mariadb/sqlite testing since I don't have a production install that uses postgresql, only a test one that has been running for a while with a smaller set of integrations.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 31, 2023

Testing is good on this. From my perspective this seems GTG now

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 31, 2023

unmarking draft since 2.0.0 is out #86436 (comment)

@bdraco bdraco marked this pull request as ready for review January 31, 2023 20:48
@bdraco bdraco requested a review from dgomes as a code owner January 31, 2023 20:48
@emontnemery emontnemery marked this pull request as draft January 31, 2023 21:44
@emontnemery
Copy link
Copy Markdown
Contributor Author

Let's keep this as draft until a week after 2023.2 is released

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 31, 2023

Sounds like a good idea. There is bound to be something that might conflict 👍

@bdraco bdraco changed the title Upgrade SQLAlchemy to 2.0.0 Upgrade SQLAlchemy to 2.0.1 Feb 1, 2023
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 1, 2023

Something is wrong with logbook queries. They are taking 10x longer than expected

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 1, 2023

Its not this PR, its #87108

@bdraco bdraco changed the title Upgrade SQLAlchemy to 2.0.1 Upgrade SQLAlchemy to 2.0.2 Feb 7, 2023
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 7, 2023

Will merge tomorrow per previous discussion unless I hear otherwise.

@bdraco bdraco marked this pull request as ready for review February 8, 2023 14:17
@bdraco bdraco merged commit 94519de into dev Feb 8, 2023
@bdraco bdraco deleted the sql_alchemy_20 branch February 8, 2023 14:17
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants