john-bodley commented on code in PR #24197:
URL: https://github.com/apache/superset/pull/24197#discussion_r1213525474
##########
superset/connectors/sqla/models.py:
##########
@@ -869,8 +858,8 @@ def get_sqla_table(self) -> TableClause:
return tbl
def get_from_clause(
- self, template_processor: Optional[BaseTemplateProcessor] = None
- ) -> Tuple[Union[TableClause, Alias], Optional[str]]:
+ self, template_processor: BaseTemplateProcessor | None = None
+ ) -> tuple[TableClause | Alias, str | None]:
Review Comment:
Yup. The term `Optional` is such a misnomer and a bad choice to represent
something that could be `None`. The [PEP-604 typing
rewrites](https://github.com/asottile/pyupgrade#pep-604-typing-rewrites)
currently only apply to those files which contain the following,
```
from __future__ import annotations
```
though will become ubiquitous after we drop support for Python 3.9.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]