Skip to content

Commit 9414d89

Browse files
committed
Fix lint: black formatting and mypy assignment override
- black: long compilation_bindtemplate property line wrapped onto 3 lines. - mypy: parent SQLCompiler annotates bindtemplate and compilation_bindtemplate as str, and a property is a different type for static analysis (runtime behavior unchanged — descriptor returns str on access). Add # type: ignore[assignment], consistent with the # type: ignore pattern already used in base.py:52 for preparer override. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent 010803e commit 9414d89

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/databricks/sqlalchemy/_ddl.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,16 @@ class DatabricksStatementCompiler(compiler.SQLCompiler):
116116

117117
# The no-op setter makes ``SQLCompiler.__init__``'s assignment of the
118118
# default template a silent no-op so our class-level value is what
119-
# every render path reads.
120-
bindtemplate = property(lambda self: self._BIND_TEMPLATE, lambda self, _: None)
121-
compilation_bindtemplate = property(lambda self: self._BIND_TEMPLATE, lambda self, _: None)
119+
# every render path reads. ``# type: ignore[assignment]`` is required
120+
# because super declares these as ``str``, and a ``property`` is a
121+
# different type at the static-analysis level (runtime behavior is
122+
# unchanged — the descriptor returns ``str`` on access).
123+
bindtemplate = property( # type: ignore[assignment]
124+
lambda self: self._BIND_TEMPLATE, lambda self, _: None
125+
)
126+
compilation_bindtemplate = property( # type: ignore[assignment]
127+
lambda self: self._BIND_TEMPLATE, lambda self, _: None
128+
)
122129

123130
def limit_clause(self, select, **kw):
124131
"""Identical to the default implementation of SQLCompiler.limit_clause except it writes LIMIT ALL instead of LIMIT -1,

0 commit comments

Comments
 (0)