villebro commented on code in PR #22085:
URL: https://github.com/apache/superset/pull/22085#discussion_r1020033030
##########
tests/integration_tests/db_engine_specs/base_engine_spec_tests.py:
##########
@@ -229,11 +229,11 @@ def test_get_table_names(self):
""" Make sure base engine spec removes schema name from table name
ie. when try_remove_schema_from_table_name == True. """
- base_result_expected = ["table", "table_2"]
+ base_result_expected = {"table", "table_2"}
base_result = BaseEngineSpec.get_table_names(
database=mock.ANY, schema="schema", inspector=inspector
)
- self.assertListEqual(base_result_expected, base_result)
+ self.assertSetEqual(base_result_expected, base_result)
Review Comment:
could we just do this as that's what appears to be preferred these days?
```
assert base_result_expected == base_result
```
##########
superset/models/core.py:
##########
@@ -556,13 +556,17 @@ def get_all_table_names_in_schema( # pylint:
disable=unused-argument
:param cache: whether cache is enabled for the function
:param cache_timeout: timeout in seconds for the cache
:param force: whether to force refresh the cache
- :return: list of tables
+ :return: set of tables
Review Comment:
code style: Some people consider including the type in the return
description bad practice if it's already typed in the sig. I'm not sure which
camp I belong to (it varies from day to day), but maybe we could rather try to
be more expressive regarding the funny `Tuple[str, str]` thingy, something like
```
:return: table name and schema pairs
```
--
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]