Skip to content

Remove SQLAlchemy stubs #10389

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

Merged
merged 7 commits into from
Jul 8, 2023
Merged

Remove SQLAlchemy stubs #10389

merged 7 commits into from
Jul 8, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jun 30, 2023

I don't feel quite comfortable with this PR for several reasons (and not because it is 30 Jun and not 1 Jul today 😆):

  1. I remember Remove Flask-SQLAlchemy #9989 So, maybe we should delete them together?
  2. I think that these stubs are widely used and most people are stuck with SQLAlchemy@1 with no chances to update to v2. Do we want to leave them with all the existing typing imperfections?
  3. There are still some dependent packages. For example, Flask-Migrate

Refs #9595
Supersedes #9989
Closes #9607
Closes #8885
Closes #9597

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

  1. I remember Remove Flask-SQLAlchemy #9989 So, maybe we should delete them together?

Judging from the pytype errors, it looks like we'll have to

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jun 30, 2023

pytype_test.py is now failing because:

  • Flask-SQLAlchemy becomes a non-types dependency of Flask-Migrate in this PR
  • pytype_test.py tries to inspect the top_level.txt file of all installed non-types dependencies
  • Flask-SQLAlchemy uses pdm as its build backend, and pdm does not create top_level.txt files in the same way that setuptools does

@github-actions

This comment has been minimized.

AlexWaygood added a commit to AlexWaygood/mypy_primer that referenced this pull request Jun 30, 2023
These packages all depend on SQLAlchemy (see python/typeshed#10389 (comment)), and SQLAlchemy >2 is `py.typed`.

streamlit also depends on SQLAlchemy, but pins to SQLAlchemy <2, so there's no point installing it for checking streamlit: https://github.com/streamlit/streamlit/blob/a49d6b327972fb98839b487119702ed58d1ca539/lib/test-requirements.txt#L40-L42
JelleZijlstra pushed a commit to hauntsaninja/mypy_primer that referenced this pull request Jun 30, 2023
These packages all depend on SQLAlchemy (see python/typeshed#10389 (comment)), and SQLAlchemy >2 is `py.typed`.

streamlit also depends on SQLAlchemy, but pins to SQLAlchemy <2, so there's no point installing it for checking streamlit: https://github.com/streamlit/streamlit/blob/a49d6b327972fb98839b487119702ed58d1ca539/lib/test-requirements.txt#L40-L42
@github-actions

This comment has been minimized.

AlexWaygood and others added 2 commits June 30, 2023 22:08
@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jun 30, 2023

Well, I had hoped that #10391 would resolve the pytype CI failures here, but it doesn't look like that's the case. It seems like the dictionary returned by importlib.metadata.packages_distributions() in CI doesn't include flask_sqlalchemy as a key when Flask-SQLAlchemy is installed. This is strange, as it does for me when I run the same commands locally on Windows. I don't understand what's causing this issue.

@sobolevn
Copy link
Member Author

I don't understand what's causing this issue.

Me neither.
CC @rchen152 as pytype expert

@AlexWaygood
Copy link
Member

All green now after #10393 🥳🥳

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

optuna (https://github.com/optuna/optuna)
+ optuna/storages/_rdb/models.py:89: error: Need type annotation for "direction"  [var-annotated]
+ optuna/storages/_rdb/models.py:174: error: Need type annotation for "state"  [var-annotated]
- optuna/storages/_rdb/models.py:64: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:72: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:94: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:111: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:119: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:143: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:151: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:179: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:187: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:213: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:245: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:282: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:290: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:314: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:322: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:347: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:357: error: Argument 1 to "find_or_raise_by_id" of "TrialModel" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/models.py:357: error: Argument 1 to "find_or_raise_by_id" of "TrialModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/models.py:368: error: Argument 1 to "json_to_distribution" has incompatible type "Column"; expected "str"  [arg-type]
+ optuna/storages/_rdb/models.py:368: error: Argument 1 to "json_to_distribution" has incompatible type "Column[str]"; expected "str"  [arg-type]
- optuna/storages/_rdb/models.py:369: error: Argument 1 to "json_to_distribution" has incompatible type "Column"; expected "str"  [arg-type]
+ optuna/storages/_rdb/models.py:369: error: Argument 1 to "json_to_distribution" has incompatible type "Column[str]"; expected "str"  [arg-type]
+ optuna/storages/_rdb/models.py:415: error: Need type annotation for "value_type"  [var-annotated]
+ optuna/storages/_rdb/models.py:481: error: Need type annotation for "intermediate_value_type"  [var-annotated]
+ optuna/storages/_rdb/models.py:571: error: Incompatible return value type (got "VersionInfoModel | None", expected "VersionInfoModel")  [return-value]
- optuna/storages/_rdb/models.py:377: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:418: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:451: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:484: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:524: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:549: error: Call to untyped function "backref" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:556: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/models.py:569: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
- optuna/storages/_rdb/storage.py:311: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:311: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:323: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:323: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:330: error: Incompatible return value type (got "Column", expected "int")  [return-value]
+ optuna/storages/_rdb/storage.py:330: error: Incompatible return value type (got "Column[int]", expected "int")  [return-value]
- optuna/storages/_rdb/storage.py:337: error: Incompatible return value type (got "Column", expected "str")  [return-value]
+ optuna/storages/_rdb/storage.py:337: error: Incompatible return value type (got "Column[str]", expected "str")  [return-value]
- optuna/storages/_rdb/storage.py:351: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:351: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:353: error: Incompatible return value type (got "dict[Column, Any]", expected "dict[str, Any]")  [return-value]
+ optuna/storages/_rdb/storage.py:353: error: Incompatible return value type (got "dict[Column[str], Any]", expected "dict[str, Any]")  [return-value]
- optuna/storages/_rdb/storage.py:360: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:360: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:362: error: Incompatible return value type (got "dict[Column, Any]", expected "dict[str, Any]")  [return-value]
+ optuna/storages/_rdb/storage.py:362: error: Incompatible return value type (got "dict[Column[str], Any]", expected "dict[str, Any]")  [return-value]
- optuna/storages/_rdb/storage.py:370: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:370: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:372: error: Incompatible return value type (got "dict[Column, Any]", expected "dict[str, Any]")  [return-value]
+ optuna/storages/_rdb/storage.py:372: error: Incompatible return value type (got "dict[Column[str], Any]", expected "dict[str, Any]")  [return-value]
- optuna/storages/_rdb/storage.py:380: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:380: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:382: error: Incompatible return value type (got "dict[Column, Any]", expected "dict[str, Any]")  [return-value]
+ optuna/storages/_rdb/storage.py:382: error: Incompatible return value type (got "dict[Column[str], Any]", expected "dict[str, Any]")  [return-value]
- optuna/storages/_rdb/storage.py:409: error: "tuple[Any, ...]" has no attribute "study_id"  [attr-defined]
- optuna/storages/_rdb/storage.py:410: error: "tuple[Any, ...]" has no attribute "study_id"  [attr-defined]
- optuna/storages/_rdb/storage.py:411: error: "tuple[Any, ...]" has no attribute "study_id"  [attr-defined]
- optuna/storages/_rdb/storage.py:414: error: "tuple[Any, ...]" has no attribute "study_name"  [attr-defined]
- optuna/storages/_rdb/storage.py:416: error: Argument "directions" to "FrozenStudy" has incompatible type "list[Column]"; expected "Sequence[StudyDirection] | None"  [arg-type]
+ optuna/storages/_rdb/storage.py:416: error: Argument "directions" to "FrozenStudy" has incompatible type "list[Column[Any]]"; expected "Sequence[StudyDirection] | None"  [arg-type]
- optuna/storages/_rdb/storage.py:417: error: Key expression in dictionary comprehension has incompatible type "Column"; expected type "str"  [misc]
+ optuna/storages/_rdb/storage.py:417: error: Key expression in dictionary comprehension has incompatible type "Column[str]"; expected type "str"  [misc]
- optuna/storages/_rdb/storage.py:417: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:417: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:418: error: Key expression in dictionary comprehension has incompatible type "Column"; expected type "str"  [misc]
+ optuna/storages/_rdb/storage.py:418: error: Key expression in dictionary comprehension has incompatible type "Column[str]"; expected type "str"  [misc]
- optuna/storages/_rdb/storage.py:418: error: Argument 1 to "loads" has incompatible type "Column"; expected "str | bytes | bytearray"  [arg-type]
+ optuna/storages/_rdb/storage.py:418: error: Argument 1 to "loads" has incompatible type "Column[str]"; expected "str | bytes | bytearray"  [arg-type]
- optuna/storages/_rdb/storage.py:419: error: "tuple[Any, ...]" has no attribute "study_id"  [attr-defined]
- optuna/storages/_rdb/storage.py:466: error: Incompatible types in assignment (expression has type "Column", variable has type "int")  [assignment]
+ optuna/storages/_rdb/storage.py:466: error: Incompatible types in assignment (expression has type "Column[int]", variable has type "int")  [assignment]
- optuna/storages/_rdb/storage.py:467: error: Incompatible types in assignment (expression has type "Column", variable has type "datetime | None")  [assignment]
+ optuna/storages/_rdb/storage.py:467: error: Incompatible types in assignment (expression has type "Column[datetime]", variable has type "datetime | None")  [assignment]
- optuna/storages/_rdb/storage.py:468: error: Incompatible types in assignment (expression has type "Column", variable has type "int")  [assignment]
+ optuna/storages/_rdb/storage.py:468: error: Incompatible types in assignment (expression has type "Column[int]", variable has type "int")  [assignment]
- optuna/storages/_rdb/storage.py:471: error: Argument "number" to "FrozenTrial" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:471: error: Argument "number" to "FrozenTrial" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:472: error: Argument "state" to "FrozenTrial" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:472: error: Argument "state" to "FrozenTrial" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:475: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "Column"; expected "datetime | None"  [arg-type]
+ optuna/storages/_rdb/storage.py:475: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "Column[datetime]"; expected "datetime | None"  [arg-type]
- optuna/storages/_rdb/storage.py:482: error: Argument "trial_id" to "FrozenTrial" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:482: error: Argument "trial_id" to "FrozenTrial" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:527: error: Argument 2 to "_set_trial_value_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:527: error: Argument 2 to "_set_trial_value_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:530: error: Argument 2 to "_set_trial_value_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:530: error: Argument 2 to "_set_trial_value_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:537: error: Argument 2 to "_set_trial_param_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:537: error: Argument 2 to "_set_trial_param_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:541: error: Argument 2 to "_set_trial_user_attr_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:541: error: Argument 2 to "_set_trial_user_attr_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:544: error: Argument 2 to "_set_trial_system_attr_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:544: error: Argument 2 to "_set_trial_system_attr_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:548: error: Argument 2 to "_set_trial_intermediate_value_without_commit" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:548: error: Argument 2 to "_set_trial_intermediate_value_without_commit" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:551: error: Incompatible types in assignment (expression has type "TrialState", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:551: error: Incompatible types in assignment (expression has type "TrialState", variable has type "Column[Any]")  [assignment]
- optuna/storages/_rdb/storage.py:553: error: Incompatible types in assignment (expression has type "int", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:553: error: Incompatible types in assignment (expression has type "int", variable has type "Column[int]")  [assignment]
- optuna/storages/_rdb/storage.py:579: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:579: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:588: error: Argument 1 to "json_to_distribution" has incompatible type "Column"; expected "str"  [arg-type]
+ optuna/storages/_rdb/storage.py:588: error: Argument 1 to "json_to_distribution" has incompatible type "Column[str]"; expected "str"  [arg-type]
- optuna/storages/_rdb/storage.py:591: error: Incompatible types in assignment (expression has type "float", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:591: error: Incompatible types in assignment (expression has type "float", variable has type "Column[float]")  [assignment]
- optuna/storages/_rdb/storage.py:592: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:592: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:632: error: Incompatible return value type (got "Column", expected "float")  [return-value]
+ optuna/storages/_rdb/storage.py:632: error: Incompatible return value type (got "Column[float]", expected "float")  [return-value]
- optuna/storages/_rdb/storage.py:640: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:640: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:649: error: Incompatible types in assignment (expression has type "TrialState", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:649: error: Incompatible types in assignment (expression has type "TrialState", variable has type "Column[Any]")  [assignment]
- optuna/storages/_rdb/storage.py:652: error: Incompatible types in assignment (expression has type "datetime", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:652: error: Incompatible types in assignment (expression has type "datetime", variable has type "Column[datetime]")  [assignment]
- optuna/storages/_rdb/storage.py:655: error: Incompatible types in assignment (expression has type "datetime", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:655: error: Incompatible types in assignment (expression has type "datetime", variable has type "Column[datetime]")  [assignment]
- optuna/storages/_rdb/storage.py:664: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:664: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:674: error: Incompatible types in assignment (expression has type "float | None", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:674: error: Incompatible types in assignment (expression has type "float | None", variable has type "Column[float]")  [assignment]
- optuna/storages/_rdb/storage.py:675: error: Incompatible types in assignment (expression has type "TrialValueType", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:675: error: Incompatible types in assignment (expression has type "TrialValueType", variable has type "Column[Any]")  [assignment]
- optuna/storages/_rdb/storage.py:693: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:693: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:713: error: Incompatible types in assignment (expression has type "float | None", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:713: error: Incompatible types in assignment (expression has type "float | None", variable has type "Column[float]")  [assignment]
- optuna/storages/_rdb/storage.py:714: error: Incompatible types in assignment (expression has type "TrialIntermediateValueType", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:714: error: Incompatible types in assignment (expression has type "TrialIntermediateValueType", variable has type "Column[Any]")  [assignment]
- optuna/storages/_rdb/storage.py:724: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:724: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:733: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:733: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:743: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:743: error: Argument 2 to "check_trial_is_updatable" of "BaseStorage" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:752: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:752: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:757: error: Call to untyped function "one_or_none" in typed context  [no-untyped-call]
+ optuna/storages/_rdb/storage.py:803: error: Argument 1 to "in_" of "SQLCoreOperations" has incompatible type "Container[TrialState]"; expected "Iterable[Any] | BindParameter[Any] | InElementRole"  [arg-type]
- optuna/storages/_rdb/storage.py:807: error: Incompatible types in assignment (expression has type "set[Any]", variable has type "list[tuple[Any]]")  [assignment]
+ optuna/storages/_rdb/storage.py:807: error: Incompatible types in assignment (expression has type "set[Any]", variable has type "list[Row[tuple[int]]]")  [assignment]
- optuna/storages/_rdb/storage.py:867: error: Argument "number" to "FrozenTrial" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:867: error: Argument "number" to "FrozenTrial" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:868: error: Argument "state" to "FrozenTrial" has incompatible type "Column"; expected "TrialState"  [arg-type]
+ optuna/storages/_rdb/storage.py:868: error: Argument "state" to "FrozenTrial" has incompatible type "Column[Any]"; expected "TrialState"  [arg-type]
- optuna/storages/_rdb/storage.py:871: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "Column"; expected "datetime | None"  [arg-type]
+ optuna/storages/_rdb/storage.py:871: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "Column[datetime]"; expected "datetime | None"  [arg-type]
- optuna/storages/_rdb/storage.py:872: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "Column"; expected "datetime | None"  [arg-type]
+ optuna/storages/_rdb/storage.py:872: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "Column[datetime]"; expected "datetime | None"  [arg-type]
- optuna/storages/_rdb/storage.py:893: error: Argument "trial_id" to "FrozenTrial" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:893: error: Argument "trial_id" to "FrozenTrial" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:911: error: Argument 1 to "get_trial" of "RDBStorage" has incompatible type "Column"; expected "int"  [arg-type]
+ optuna/storages/_rdb/storage.py:911: error: Argument 1 to "get_trial" of "RDBStorage" has incompatible type "Column[int]"; expected "int"  [arg-type]
- optuna/storages/_rdb/storage.py:976: error: Incompatible types in assignment (expression has type "Any | None", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:976: error: Incompatible types in assignment (expression has type "Any | None", variable has type "Column[datetime]")  [assignment]
- optuna/storages/_rdb/storage.py:1008: error: Incompatible return value type (got "list[Column]", expected "list[int]")  [return-value]
+ optuna/storages/_rdb/storage.py:1008: error: Incompatible return value type (got "list[Column[int]]", expected "list[int]")  [return-value]
- optuna/storages/_rdb/storage.py:1132: error: Incompatible types in assignment (expression has type "int", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:1132: error: Incompatible types in assignment (expression has type "int", variable has type "Column[int]")  [assignment]
- optuna/storages/_rdb/storage.py:1133: error: Incompatible types in assignment (expression has type "str", variable has type "Column")  [assignment]
+ optuna/storages/_rdb/storage.py:1133: error: Incompatible types in assignment (expression has type "str", variable has type "Column[str]")  [assignment]
- optuna/storages/_rdb/storage.py:1143: error: Incompatible return value type (got "ColumnOperators[Any]", expected "bool")  [return-value]
+ optuna/storages/_rdb/storage.py:1143: error: Incompatible return value type (got "ColumnElement[bool]", expected "bool")  [return-value]
- tests/storages_tests/rdb_tests/test_models.py:51: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:51: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:64: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:64: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:69: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:69: error: Argument 1 to "where_study_id" of "StudyDirectionModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:97: error: Argument 1 to "where_study_id" of "StudySystemAttributeModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:97: error: Argument 1 to "where_study_id" of "StudySystemAttributeModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:98: error: Argument 1 to "where_study_id" of "StudySystemAttributeModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:98: error: Argument 1 to "where_study_id" of "StudySystemAttributeModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:298: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:298: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:313: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:313: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:318: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:318: error: Argument 1 to "where_trial_id" of "TrialValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:354: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:354: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:373: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:373: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:378: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:378: error: Argument 1 to "where_trial_id" of "TrialIntermediateValueModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:396: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:396: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:405: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:405: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
- tests/storages_tests/rdb_tests/test_models.py:410: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_models.py:410: error: Argument 1 to "where_trial_id" of "TrialHeartbeatModel" has incompatible type "Column[int]"; expected "int"  [arg-type]
+ tests/storages_tests/rdb_tests/test_storage.py:37: error: Item "None" of "VersionInfoModel | None" has no attribute "schema_version"  [union-attr]
+ tests/storages_tests/rdb_tests/test_storage.py:38: error: Item "None" of "VersionInfoModel | None" has no attribute "library_version"  [union-attr]
+ tests/storages_tests/rdb_tests/test_storage.py:58: error: Item "None" of "str | None" has no attribute "endswith"  [union-attr]
+ tests/storages_tests/rdb_tests/test_storage.py:124: error: Incompatible types in assignment (expression has type "int", variable has type "Column[int]")  [assignment]

ibis (https://github.com/ibis-project/ibis)
+ ibis/backends/conftest.py:215: error: Property "database" defined in "URL" is read-only  [misc]
+ ibis/backends/oracle/tests/conftest.py:165: error: Property "database" defined in "URL" is read-only  [misc]
+ ibis/backends/base/sql/alchemy/datatypes.py:262: error: Incompatible return value type (got "object", expected "TypeEngine[Any]")  [return-value]
+ ibis/backends/base/sql/alchemy/datatypes.py:283: error: Argument 1 to "get" of "dict" has incompatible type "int | None"; expected "int"  [arg-type]
- ibis/backends/conftest.py:215: error: Property "database" defined in "_URLTuple" is read-only  [misc]
- ibis/backends/oracle/tests/conftest.py:165: error: Property "database" defined in "_URLTuple" is read-only  [misc]
- ibis/backends/base/sql/alchemy/datatypes.py:21: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:45: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:61: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:62: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:120: error: Module has no attribute "UUID"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:220: error: Module has no attribute "registry"  [attr-defined]
- ibis/backends/base/sql/alchemy/datatypes.py:222: error: Module has no attribute "to_instance"  [attr-defined]
+ ibis/backends/postgres/datatypes.py:129: error: Incompatible return value type (got "type[DOUBLE_PRECISION[Any]]", expected "TypeEngine[Any]")  [return-value]
+ ibis/backends/postgres/datatypes.py:131: error: Incompatible return value type (got "type[REAL[Any]]", expected "TypeEngine[Any]")  [return-value]
+ ibis/backends/postgres/datatypes.py:156: error: Item "None" of "str | None" has no attribute "upper"  [union-attr]
- ibis/backends/base/sql/alchemy/translator.py:87: error: Module has no attribute "registry"  [attr-defined]
+ ibis/backends/base/sql/alchemy/__init__.py:318: error: Argument 1 to "from_select" of "Insert" has incompatible type "ReadOnlyColumnCollection[str, Column[Any]]"; expected "Sequence[str | _HasClauseElement | DMLColumnRole | SQLCoreOperations[Any]]"  [arg-type]
+ ibis/backends/sqlite/datatypes.py:53: error: Incompatible return value type (got "type[REAL[Any]]", expected "TypeEngine[Any]")  [return-value]
- ibis/backends/base/sql/alchemy/__init__.py:106: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/base/sql/alchemy/__init__.py:536: error: "Dialect" has no attribute "identifier_preparer"  [attr-defined]
- ibis/backends/base/sql/alchemy/__init__.py:691: error: "normalize_name" of "Dialect" does not return a value  [func-returns-value]
- ibis/backends/base/sql/alchemy/__init__.py:756: error: "Dialect" has no attribute "identifier_preparer"  [attr-defined]
- ibis/backends/sqlite/datatypes.py:53: error: Incompatible return value type (got "type[REAL]", expected "TypeEngine")  [return-value]
- ibis/backends/postgres/datatypes.py:129: error: Incompatible return value type (got "type[DOUBLE_PRECISION]", expected "TypeEngine")  [return-value]
- ibis/backends/postgres/datatypes.py:131: error: Incompatible return value type (got "type[REAL]", expected "TypeEngine")  [return-value]
+ ibis/backends/mysql/compiler.py:14: error: Incompatible types in assignment (expression has type "_FunctionGenerator", base class "AlchemyExprTranslator" defined the type as "staticmethod[[VarArg(Any), KwArg(Any)], Function[Any]]")  [assignment]
- ibis/backends/snowflake/__init__.py:115: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/snowflake/__init__.py:119: error: "IdentifierPreparer" not callable  [operator]
- ibis/backends/snowflake/__init__.py:423: error: "IdentifierPreparer" not callable  [operator]
- ibis/backends/snowflake/__init__.py:464: error: Module has no attribute "to_instance"  [attr-defined]
- ibis/backends/druid/__init__.py:51: error: Incompatible types in assignment (expression has type "Callable[[Any, str, Any], bool]", variable has type "Callable[[Any, Any, Any | None, KwArg(Any)], None]")  [assignment]
+ ibis/backends/druid/__init__.py:51: error: Incompatible types in assignment (expression has type "Callable[[Any, str, Any], bool]", variable has type "Callable[[Connection, str, str | None, KwArg(Any)], bool]")  [assignment]
+ ibis/backends/duckdb/__init__.py:55: error: Need type annotation for "bindparam"  [var-annotated]
+ ibis/backends/duckdb/__init__.py:330: error: Need type annotation for "source"  [var-annotated]
+ ibis/backends/duckdb/__init__.py:379: error: Need type annotation for "source"  [var-annotated]
+ ibis/backends/duckdb/__init__.py:439: error: Need type annotation for "source"  [var-annotated]
+ ibis/backends/duckdb/__init__.py:570: error: Need type annotation for "source"  [var-annotated]
+ ibis/backends/duckdb/__init__.py:612: error: Need type annotation for "source"  [var-annotated]
- ibis/backends/duckdb/__init__.py:1016: error: "Dialect" has no attribute "identifier_preparer"  [attr-defined]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/connections/sql_connection.py:28:1: error: Cannot find implementation or library stub for module named "sqlalchemy.engine.base"  [import]
+ lib/streamlit/connections/sql_connection.py:29:1: error: Cannot find implementation or library stub for module named "sqlalchemy.orm"  [import]
+ lib/streamlit/connections/sql_connection.py:79:1: error: Cannot find implementation or library stub for module named "sqlalchemy"  [import]
+ lib/streamlit/connections/sql_connection.py:180:1: error: Cannot find implementation or library stub for module named "sqlalchemy.exc"  [import]
- lib/tests/streamlit/connections/sql_connection_test.py:194:16: error: "Callable[[bool, KwArg(Any)], Engine]" has no attribute "call_count"  [attr-defined]
- lib/tests/streamlit/connections/sql_connection_test.py:195:9: error: "Callable[[bool, KwArg(Any)], Engine]" has no attribute "reset_mock"  [attr-defined]
- lib/tests/streamlit/connections/sql_connection_test.py:209:16: error: "Callable[[bool, KwArg(Any)], Engine]" has no attribute "call_count"  [attr-defined]
- lib/tests/streamlit/connections/sql_connection_test.py:210:9: error: "Callable[[bool, KwArg(Any)], Engine]" has no attribute "reset_mock"  [attr-defined]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:35:1: error: Cannot find implementation or library stub for module named "sqlalchemy"  [import]
+ lib/tests/streamlit/connections/sql_connection_test.py:22:1: error: Cannot find implementation or library stub for module named "sqlalchemy.exc"  [import]
+ lib/tests/streamlit/connections/sql_connection_test.py:194:16: error: "Callable[[bool, KwArg(Any)], Any]" has no attribute "call_count"  [attr-defined]
+ lib/tests/streamlit/connections/sql_connection_test.py:195:9: error: "Callable[[bool, KwArg(Any)], Any]" has no attribute "reset_mock"  [attr-defined]
+ lib/tests/streamlit/connections/sql_connection_test.py:209:16: error: "Callable[[bool, KwArg(Any)], Any]" has no attribute "call_count"  [attr-defined]
+ lib/tests/streamlit/connections/sql_connection_test.py:210:9: error: "Callable[[bool, KwArg(Any)], Any]" has no attribute "reset_mock"  [attr-defined]

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/server/utilities/database.py:436: error: Incompatible types in assignment (expression has type "type[BOOLEAN]", base class "ColumnElement" defined the type as "TypeEngine[Any]")  [assignment]
+ src/prefect/server/utilities/database.py:507: error: Incompatible types in assignment (expression has type "type[BOOLEAN]", base class "ColumnElement" defined the type as "TypeEngine[Any]")  [assignment]
+ src/prefect/server/utilities/database.py:562: error: Incompatible types in assignment (expression has type "type[BOOLEAN]", base class "ColumnElement" defined the type as "TypeEngine[Any]")  [assignment]
+ src/prefect/server/utilities/database.py:625: error: Item "Connection" of "Engine | Connection | None" has no attribute "url"  [union-attr]
+ src/prefect/server/utilities/database.py:625: error: Item "None" of "Engine | Connection | None" has no attribute "url"  [union-attr]
+ src/prefect/server/utilities/database.py:631: error: Invalid self argument "URL" to attribute function "get_dialect" with type "Callable[[URL, bool], type[Dialect]]"  [misc]
+ src/prefect/server/utilities/database.py:631: error: Incompatible return value type (got "type[Dialect] | Any", expected "Dialect")  [return-value]
+ src/prefect/server/database/query_components.py:213: error: Argument 2 to "where" of "Select" has incompatible type "Any | bool"; expected "ColumnElement[bool] | _HasClauseElement | SQLCoreOperations[bool] | ExpressionElementRole[bool] | Callable[[], ColumnElement[bool]] | LambdaElement"  [arg-type]
+ src/prefect/server/database/query_components.py:258: error: Need type annotation for "join_criteria"  [var-annotated]
+ src/prefect/server/database/query_components.py:422: error: Incompatible types in assignment (expression has type "CTE", variable has type "Select[Any]")  [assignment]
+ src/prefect/server/database/query_components.py:481: error: No overload variant of "aliased" matches argument types "Any", "CTE"  [call-overload]
+ src/prefect/server/database/query_components.py:481: note: Possible overload variants:
+ src/prefect/server/database/query_components.py:481: note:     def [_O] aliased(element: type[_O], alias: Alias | Subquery | None = ..., name: str | None = ..., flat: bool = ..., adapt_on_names: bool = ...) -> type[_O]
+ src/prefect/server/database/query_components.py:481: note:     def [_O] aliased(element: AliasedClass[_O] | Mapper[_O] | AliasedInsp[_O], alias: Alias | Subquery | None = ..., name: str | None = ..., flat: bool = ..., adapt_on_names: bool = ...) -> AliasedClass[_O]
+ src/prefect/server/database/query_components.py:481: note:     def aliased(element: FromClause, alias: Alias | Subquery | None = ..., name: str | None = ..., flat: bool = ..., adapt_on_names: bool = ...) -> FromClause
- src/prefect/server/database/query_components.py:505: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/database/query_components.py:505: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/database/query_components.py:662: error: Incompatible return value type (got "Sequence[Row[Any]]", expected "list[Any]")  [return-value]
+ src/prefect/server/database/query_components.py:844: error: Incompatible return value type (got "Sequence[Row[Any]]", expected "list[Any]")  [return-value]
+ src/prefect/server/database/orm_models.py:63: error: Need type annotation for "id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:70: error: Need type annotation for "created"  [var-annotated]
+ src/prefect/server/database/orm_models.py:80: error: Need type annotation for "updated"  [var-annotated]
+ src/prefect/server/database/orm_models.py:123: error: Need type annotation for "type"  [var-annotated]
+ src/prefect/server/database/orm_models.py:126: error: Need type annotation for "timestamp"  [var-annotated]
+ src/prefect/server/database/orm_models.py:134: error: Need type annotation for "state_details"  [var-annotated]
+ src/prefect/server/database/orm_models.py:208: error: Need type annotation for "type"  [var-annotated]
+ src/prefect/server/database/orm_models.py:211: error: Need type annotation for "timestamp"  [var-annotated]
+ src/prefect/server/database/orm_models.py:219: error: Need type annotation for "state_details"  [var-annotated]
+ src/prefect/server/database/orm_models.py:332: error: Need type annotation for "latest_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:334: error: Need type annotation for "task_run_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:339: error: Need type annotation for "flow_run_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:367: error: Need type annotation for "cache_expiration"  [var-annotated]
+ src/prefect/server/database/orm_models.py:371: error: Need type annotation for "task_run_state_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:396: error: Need type annotation for "state_type"  [var-annotated]
+ src/prefect/server/database/orm_models.py:398: error: Need type annotation for "state_timestamp"  [var-annotated]
+ src/prefect/server/database/orm_models.py:400: error: Need type annotation for "expected_start_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:401: error: Need type annotation for "next_scheduled_start_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:402: error: Need type annotation for "start_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:403: error: Need type annotation for "end_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:404: error: Need type annotation for "total_run_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:492: error: Need type annotation for "deployment_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:498: error: Need type annotation for "empirical_policy"  [var-annotated]
+ src/prefect/server/database/orm_models.py:505: error: Need type annotation for "created_by"  [var-annotated]
+ src/prefect/server/database/orm_models.py:694: error: Need type annotation for "cache_expiration"  [var-annotated]
+ src/prefect/server/database/orm_models.py:699: error: Need type annotation for "empirical_policy"  [var-annotated]
+ src/prefect/server/database/orm_models.py:705: error: Need type annotation for "task_inputs"  [var-annotated]
+ src/prefect/server/database/orm_models.py:867: error: Need type annotation for "schedule"  [var-annotated]
+ src/prefect/server/database/orm_models.py:875: error: Need type annotation for "created_by"  [var-annotated]
+ src/prefect/server/database/orm_models.py:881: error: Need type annotation for "updated_by"  [var-annotated]
+ src/prefect/server/database/orm_models.py:940: error: Need type annotation for "flow_run_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:941: error: Need type annotation for "task_run_id"  [var-annotated]
+ src/prefect/server/database/orm_models.py:945: error: Need type annotation for "timestamp"  [var-annotated]
+ src/prefect/server/database/orm_models.py:1162: error: Need type annotation for "filter"  [var-annotated]
+ src/prefect/server/database/orm_models.py:1175: error: Need type annotation for "last_polled"  [var-annotated]
+ src/prefect/server/database/orm_models.py:1236: error: Need type annotation for "last_heartbeat_time"  [var-annotated]
+ src/prefect/server/database/orm_models.py:1264: error: Need type annotation for "last_activity_time"  [var-annotated]
+ src/prefect/server/models/workers.py:84: error: Incompatible return value type (got "Any | None", expected "ORMWorkPool")  [return-value]
+ src/prefect/server/models/workers.py:103: error: Incompatible return value type (got "Any | None", expected "ORMWorkPool")  [return-value]
+ src/prefect/server/models/workers.py:135: error: Incompatible return value type (got "Sequence[Any]", expected "list[ORMWorkPool]")  [return-value]
+ src/prefect/server/models/workers.py:166: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/workers.py:187: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/workers.py:405: error: Incompatible return value type (got "Sequence[Any]", expected "list[ORMWorkQueue]")  [return-value]
+ src/prefect/server/models/workers.py:425: error: Incompatible return value type (got "ORMWorkQueue | None", expected "ORMWorkQueue")  [return-value]
+ src/prefect/server/models/workers.py:456: error: Incompatible return value type (got "Any | None", expected "ORMWorkQueue")  [return-value]
+ src/prefect/server/models/workers.py:486: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/workers.py:487: error: Incompatible types in assignment (expression has type "WorkQueueUpdate | None", variable has type "WorkQueueUpdate")  [assignment]
+ src/prefect/server/models/workers.py:493: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/workers.py:570: error: Incompatible return value type (got "Sequence[Any]", expected "list[ORMWorker]")  [return-value]
+ src/prefect/server/models/workers.py:610: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/variables.py:110: error: Incompatible return value type (got "int | None", expected "int")  [return-value]
+ src/prefect/server/models/variables.py:130: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/variables.py:150: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/variables.py:166: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/variables.py:182: error: "Result[Any]" has no attribute "rowcount"  [attr-defined]
+ src/prefect/server/models/task_run_states.py:30: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/task_run_states.py:53: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/task_run_states.py:53: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/task_run_states.py:72: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/task_run_states.py:72: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/saved_searches.py:45: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:45: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/saved_searches.py:54: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:54: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:75: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/saved_searches.py:92: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:92: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/saved_searches.py:124: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:124: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/saved_searches.py:143: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/saved_searches.py:143: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:40: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:40: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:50: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:50: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:79: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:79: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:95: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:111: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:111: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:218: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:218: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:259: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:259: error: Incompatible types in "await" (actual type "Result[tuple[int]]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flows.py:278: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flows.py:278: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_states.py:30: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flow_run_states.py:53: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_states.py:53: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flow_run_states.py:72: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_states.py:72: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_notification_policies.py:69: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flow_run_notification_policies.py:106: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_notification_policies.py:106: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flow_run_notification_policies.py:137: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_notification_policies.py:137: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/flow_run_notification_policies.py:158: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/flow_run_notification_policies.py:158: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:44: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:44: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:52: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:52: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:71: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:71: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:88: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:88: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:103: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:103: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:131: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:131: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:145: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:145: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:157: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:157: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/concurrency_limits.py:188: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/concurrency_limits.py:188: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:51: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:51: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:63: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:63: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:83: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:101: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:101: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:142: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:142: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:169: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:169: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/block_types.py:188: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/block_types.py:188: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:39: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:39: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:51: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:51: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:86: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:86: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:95: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:95: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:141: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:141: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:157: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:157: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:297: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:297: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:344: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:344: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:378: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:378: error: Incompatible types in "await" (actual type "Result[tuple[int]]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:412: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:412: error: Incompatible types in "await" (actual type "Result[tuple[int]]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:442: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:442: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:450: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:450: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:488: error: Incompatible types in "await" (actual type "Any | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:493: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:493: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:502: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:502: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:527: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:527: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:530: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:530: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/artifacts.py:538: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/artifacts.py:538: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/agents.py:57: error: Incompatible types in "await" (actual type "Awaitable[Any] | None", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/agents.py:86: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/agents.py:86: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/agents.py:115: error: Incompatible types in "await" (actual type "Result", expected type "Awaitable[Any]")  [misc]
+ src/prefect/server/models/agents.py:115: error: Incompatible types in "await" (actual type "Result[Any]", expected type "Awaitable[Any]")  [misc]
- src/prefect/server/models/agents.py:158: error: Incompatible types in "await" (actual type "Result", e

... (truncated 90 lines) ...

@sobolevn sobolevn marked this pull request as ready for review July 1, 2023 17:01
@sobolevn
Copy link
Member Author

sobolevn commented Jul 1, 2023

@JelleZijlstra @srittau @AlexWaygood @hauntsaninja I think that this is important enough to ask for all opinions :)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I'm in favour of this, but I'm also okay with waiting a while longer if others want to

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Upgrading to SQLAlchemy 2 is hard, but well worth it if using type annotations, as its built-in typing support is much better than anything pure stubs can achieve. According to https://pypistats.org/, this package is not very widely used, at least as compared to some other type packages. Also, the package itself doesn't go away, although we can't update it. +1 for removing the stubs now.

@AlexWaygood AlexWaygood merged commit e7ba032 into main Jul 8, 2023
@AlexWaygood AlexWaygood deleted the issue-9607 branch July 8, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants