fix: enable several pylint rules partially in db_engines_specs module (#11000)

* Enabled mssql

* Enabling pylint rules in `mysql.py` from `db_engine_specs`:
- added variable to shorten line and enable `line-too-long`
- `import-error` seems not prompting anymore
- specified exception instead broad-except

* Refactored too long line in `oracle.py` from `db_engine_specs`. Enabled too-long-line pylint rule.

* Changed fstring into string `pinot.py` to reenable `f-string-without-interpolation` rule.

* Enabled `unused-import` rule and changed line to adjust to correct number of characters in `db_engine_specs/postgres.py`.

* Enabled unused-import pylint check in `db_engine_specs/presto.py`

* Enabled unused-import pylint check in `db_engine_specs/snowflake.py`

* Enabled unused-import pylint check in `db_engine_specs/sqlite.py`
This commit is contained in:
Kasia Kucharczyk
2020-09-23 19:47:56 +02:00
committed by GitHub
parent fb6f14c469
commit af1e8e8839
8 changed files with 19 additions and 16 deletions

View File

@@ -24,7 +24,6 @@ from superset.db_engine_specs.base import BaseEngineSpec
from superset.utils import core as utils
if TYPE_CHECKING:
# pylint: disable=unused-import
from superset.models.core import Database # pragma: no cover
@@ -86,5 +85,6 @@ class PostgresEngineSpec(PostgresBaseEngineSpec):
if tt == utils.TemporalType.DATE:
return f"TO_DATE('{dttm.date().isoformat()}', 'YYYY-MM-DD')"
if tt == utils.TemporalType.TIMESTAMP:
return f"""TO_TIMESTAMP('{dttm.isoformat(sep=" ", timespec="microseconds")}', 'YYYY-MM-DD HH24:MI:SS.US')""" # pylint: disable=line-too-long
dttm_formatted = dttm.isoformat(sep=" ", timespec="microseconds")
return f"""TO_TIMESTAMP('{dttm_formatted}', 'YYYY-MM-DD HH24:MI:SS.US')"""
return None