Skip to content

miscelaneous to type mysql dialect #12231

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

Closed
wants to merge 5 commits into from

Conversation

Polandia94
Copy link
Contributor

Type of certain methods that are called on mysql dialect, so we can type mysql dialects.

Related to #12164

breaking changes:

  • Change modifiers from TextClause to InmutableDict, from Mapping, as is in the other classes

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

Nice work

A few other general remarks

  • remove string typing, since they are unnecessary, given the use of future-annotation
  • even if merging only in main we still support older python versions so it would be preferable to use thing | None -> Optional[thing], thinga | thingb -> Union[thinka, thingb]

@@ -7088,19 +7132,31 @@ def visit_identity_column(self, identity, **kw):


class GenericTypeCompiler(TypeCompiler):
def visit_FLOAT(self, type_, **kw):
def visit_FLOAT(
self, type_: "sqltypes.Float[decimal.Decimal| float]", **kw: Any
Copy link
Member

Choose a reason for hiding this comment

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

these seems to only add noise..
if we were to type them, a simple TypeEngine[Any] in all of them would likely be ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change in my next commit to more duck typiping, changing to more broad types, and TypeEngine when is not calling specific methods of string or numeric

@zzzeek
Copy link
Member

zzzeek commented Jan 12, 2025

how does this relate to #12164 ? #12164 is enormous, does this represent breaking it into smaller pieces?

It would be great if we had a series of small changes in a sequence, with the earlier changes providing quick wins like typing for the mysql/types.py that directly benefits users such as in #12243. to be honest, typing of internal things in dialects and such is extremely low priority.

@CaselIT
Copy link
Member

CaselIT commented Jan 12, 2025

how does this relate to #12164 ? #12164 is enormous, does this represent breaking it into smaller pieces?

Yes, that's the idea, this is a precursor to take care of all the types that are not in mysql dialect

@Polandia94
Copy link
Contributor Author

Thanks for the review, i think I corrected all the comments.
@zzzeek this are all the changes that are in #12164 outside dialects/mysql, almost all changes are untyped functions called or overriden from dialects/mysql, that was needed to type before type the dialect.

@CaselIT
Copy link
Member

CaselIT commented Jan 25, 2025

I'll take a second look, thanks!

@CaselIT CaselIT requested a review from sqla-tester February 8, 2025 15:46
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 514fe47 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 514fe47: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5703

@sqla-tester
Copy link
Collaborator

Michael Bayer (zzzeek) wrote:

recheck

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

@sqla-tester
Copy link
Collaborator

Federico Caselli (CaselIT) wrote:

recheck

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

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/sqlalchemy/+/5703

@@ -28,6 +28,7 @@
import collections
import collections.abc as collections_abc
import contextlib
import decimal
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

move into type checking, also some other

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

def visit_regexp_replace_op_binary(self, binary, operator, **kw):
def visit_regexp_replace_op_binary(
self, binary: elements.BinaryExpression[Any], operator: Any, **kw: Any
) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

import to avoid elements.

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

return "REAL"

def visit_NUMERIC(self, type_, **kw):
def visit_NUMERIC(self, type_: "sqltypes.Numeric[Any]", **kw: Any) -> str:
if type_.precision is None:
return "NUMERIC"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

remove ""

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

# calculate these at format time so that ad-hoc changes
# to dialect.max_identifier_length etc. can be reflected
# as IdentifierPreparer is long lived
max_ = (
self.dialect.max_index_name_length
self.dialect.max_index_name_length # type: ignore[attr-defined]
or self.dialect.max_identifier_length
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

make this available

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

# calculate these at format time so that ad-hoc changes
# to dialect.max_identifier_length etc. can be reflected
# as IdentifierPreparer is long lived
max_ = (
self.dialect.max_constraint_name_length
self.dialect.max_constraint_name_length # type: ignore[attr-defined] # NOQA: E501
or self.dialect.max_identifier_length
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

this too

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

if isinstance(name, elements._truncated_label):
if len(name) > max_:
name = name[0 : max_ - 8] + "_" + util.md5_hex(name)[-4:]
else:
self.dialect.validate_identifier(name)
self.dialect.validate_identifier(name) # type: ignore[attr-defined] # NOQA: E501

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

same

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

@sqla-tester
Copy link
Collaborator

Federico Caselli (CaselIT) wrote:

code review left on gerrit

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

@CaselIT
Copy link
Member

CaselIT commented Feb 26, 2025

@Polandia94 noting to be done from your part. I'm reviewing and done some minor cleanups to the change

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/sqlalchemy/+/5703

  • lib/sqlalchemy/engine/interfaces.py (line 2664): this

@@ -781,7 +782,7 @@ def loaded_dbapi(self) -> ModuleType:
max_identifier_length: int
"""The maximum length of identifier names."""

supports_server_side_cursors: bool
supports_server_side_cursors: Union[generic_fn_descriptor[bool], bool]
"""indicates if the dialect supports server side cursors"""

server_side_cursors: bool
Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

this

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

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/sqlalchemy/+/5703

  • /COMMIT_MSG (line 7): I see no change to mysql/* here at all, is this commit message wrong? i dont see a descendant change either
  • lib/sqlalchemy/sql/compiler.py (line 5152): OK
  • lib/sqlalchemy/sql/compiler.py (line 7174): all of these etc
  • lib/sqlalchemy/sql/compiler.py (line 7904): how about Sequence here so we can backport to 2.0 more easily
  • lib/sqlalchemy/sql/ddl.py (line 97): ugh. OK I dont like str here but we seem to be using it
  • lib/sqlalchemy/sql/ddl.py (line 685): why quotes?
  • lib/sqlalchemy/sql/ddl.py (line 705): same for all these
  • lib/sqlalchemy/sql/sqltypes.py (line 1652): we should probably assign a type alias to use for this argument throughout Enum

@@ -656,7 +656,9 @@ class CompileState:
_ambiguous_table_name_map: Optional[_AmbiguousTableNameMap]

@classmethod
def create_for_statement(cls, statement, compiler, **kw):
def create_for_statement(
cls, statement: Executable, compiler: Compiled, **kw: Any
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:

why Optional? this should not be optional

I get pep484 green with this change

 diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
 index 464033d8c..a67878f90 100644
 --- a/lib/sqlalchemy/sql/base.py
 +++ b/lib/sqlalchemy/sql/base.py
 @@ -666,7 +666,9 @@ class CompileState:
      _ambiguous_table_name_map: Optional[_AmbiguousTableNameMap]
 
      @classmethod
 -    def create_for_statement(cls, statement, compiler, **kw):
 +    def create_for_statement(
 +        cls, statement: Executable, compiler: Compiled, **kw: Any
 +    ) -> CompileState:
      # factory construction.
 
      if statement._propagate_attrs:

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

it's typed with optional in _ORMFromStatementCompileState.create_for_statement, _ORMCompileState.create_for_statement etc

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

this was fixed in another change

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

def function_argspec(self, func, **kwargs):
def function_argspec(
self, func: functions.Function[Any], **kwargs: Any
) -> str:
return func.clause_expr._compiler_dispatch(self, **kwargs)

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:

why do we add typing to some methods here and not all of them? because these are methods that MySQL overrode ?

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

yes

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

@@ -7088,19 +7137,23 @@ def visit_identity_column(self, identity, **kw):


class GenericTypeCompiler(TypeCompiler):
def visit_FLOAT(self, type_, **kw):
def visit_FLOAT(self, type_: TypeEngine[Any], **kw: Any) -> str:
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:

well these should be the correct types, FLOAT is going to be Float

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

return "FLOAT"

def visit_DOUBLE(self, type_, **kw):
def visit_DOUBLE(self, type_: TypeEngine[Any], **kw: Any) -> str:
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:

Double, etc

I can see maybe some compiler sends something unusual in but it normally should not

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

return "DOUBLE"

def visit_DOUBLE_PRECISION(self, type_, **kw):
def visit_DOUBLE_PRECISION(
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:

here

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

"""Represent a COMMENT ON TABLE IS statement."""

__visit_name__ = "set_table_comment"


class DropTableComment(_CreateDropBase):
class DropTableComment(_CreateDropBase["Table"]):
"""Represent a COMMENT ON TABLE '' statement.

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:

all of these quotes have to go

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

we would need to import them outside type checking.

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

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:

oh, sorry, I guess I forgot how this works

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

@@ -426,7 +430,14 @@ class NumericCommon(HasExpressionLookup, TypeEngineMixin, Generic[_N]):
if TYPE_CHECKING:

@util.ro_memoized_property
def _type_affinity(self) -> Type[NumericCommon[_N]]: ...
def _type_affinity(
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:

I'd rather not change this, this is actually typed with a pretty specific type so let's change it back so I can see where it is not working

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

NumericCommon is not a type engine

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

@@ -1325,7 +1336,9 @@ class MyEnum(enum.Enum):

__visit_name__ = "enum"

def __init__(self, *enums: object, **kw: Any):
enum_class: Union[None, str, type[enum.Enum]]

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:

do these overloads get us anything

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

well they error if you pass Enum(PyEnum,OtherPyEnum)

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

def _enum_init(self, enums, kw):
def _enum_init(
self, enums: Sequence[Union[str, type[enum.Enum]]], kw: dict[str, Any]
) -> None:
"""internal init for :class:`.Enum` and subclasses.
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:

same here w/ sequence...

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

Done

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

@@ -1525,7 +1542,9 @@ def _enum_init(self, enums, kw):
_adapted_from=kw.pop("_adapted_from", None),
)

def _parse_into_values(self, enums, kw):
def _parse_into_values(
self, enums: Sequence[Union[str, type[enum.Enum]]], kw: Any
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:

how come Sequence[Union[str, Type[enum.Enum]] and not Union[Sequence[str], Sequence[Type[enum.Enum]] as is done elsewhere?

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Federico Caselli (CaselIT) wrote:

enums from init has that type. since it comes from an overload. I can type ignore when calling enum_init

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

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/sqlalchemy/+/5703

  • /COMMIT_MSG (line 7): Done
  • lib/sqlalchemy/engine/interfaces.py (line 2664): Done
  • lib/sqlalchemy/sql/compiler.py (line 7174): Done
  • lib/sqlalchemy/sql/compiler.py (line 7904): Done
  • lib/sqlalchemy/sql/ddl.py (line 685): it's imported inside typechecking so they are needed
  • lib/sqlalchemy/sql/ddl.py (line 705): Done
  • lib/sqlalchemy/sql/sqltypes.py (line 1652): Done

@sqla-tester
Copy link
Collaborator

Federico Caselli (CaselIT) wrote:

code review left on gerrit

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

1 similar comment
@sqla-tester
Copy link
Collaborator

Federico Caselli (CaselIT) wrote:

code review left on gerrit

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

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/sqlalchemy/+/5784

  • lib/sqlalchemy/sql/sqltypes.py (line 1434): hm OK I guess as long as we have future annotations turned on, this dict[str, Any] isn't evaluated in older Pythons, though...do we want to support people running mypy on their codebase under 3.8 ? probably

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/sqlalchemy/+/5703

  • lib/sqlalchemy/sql/sqltypes.py (line 1488): still a dict[] here, does this otherwise do a clean cherry-pick to 2.0 ?

return self.visit_REAL(type_, **kw)

def visit_float(self, type_, **kw):
def visit_float(self, type_: TypeEngine[Any], **kw: Any) -> str:
return self.visit_FLOAT(type_, **kw)

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:

it looks great, thanks

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

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/sqlalchemy/+/5784

  • lib/sqlalchemy/sql/sqltypes.py (line 1434): it's likely a typo. Will do a pass on this

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/sqlalchemy/+/5784

  • lib/sqlalchemy/sql/sqltypes.py (line 1434): Done
  • lib/sqlalchemy/sql/sqltypes.py (line 613): the re-add of this line is the only change with the 2.1 change

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/sqlalchemy/+/5703

@sqla-tester
Copy link
Collaborator

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

@sqla-tester
Copy link
Collaborator

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

sqlalchemy-bot pushed a commit that referenced this pull request Mar 17, 2025
Type of certain methods that are called by dialect, so typing dialects is easier.

Related to #12164

breaking changes:

- Change modifiers from TextClause to InmutableDict, from Mapping, as is in the other classes

Closes: #12231
Pull-request: #12231
Pull-request-sha: 514fe47

Change-Id: I29314045b2c7eb5428f8d6fec8911c4b6d5ae73e
(cherry picked from commit 4418ef79104a0e4591ff8268d75f1deb59bfcec3)
@Polandia94 Polandia94 mentioned this pull request Mar 23, 2025
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.

4 participants