mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[format] Using Black (#7769)
This commit is contained in:
@@ -21,18 +21,18 @@ from superset.db_engine_specs.base import BaseEngineSpec, LimitMethod
|
||||
class PostgresBaseEngineSpec(BaseEngineSpec):
|
||||
""" Abstract class for Postgres 'like' databases """
|
||||
|
||||
engine = ''
|
||||
engine = ""
|
||||
|
||||
time_grain_functions = {
|
||||
None: '{col}',
|
||||
'PT1S': "DATE_TRUNC('second', {col})",
|
||||
'PT1M': "DATE_TRUNC('minute', {col})",
|
||||
'PT1H': "DATE_TRUNC('hour', {col})",
|
||||
'P1D': "DATE_TRUNC('day', {col})",
|
||||
'P1W': "DATE_TRUNC('week', {col})",
|
||||
'P1M': "DATE_TRUNC('month', {col})",
|
||||
'P0.25Y': "DATE_TRUNC('quarter', {col})",
|
||||
'P1Y': "DATE_TRUNC('year', {col})",
|
||||
None: "{col}",
|
||||
"PT1S": "DATE_TRUNC('second', {col})",
|
||||
"PT1M": "DATE_TRUNC('minute', {col})",
|
||||
"PT1H": "DATE_TRUNC('hour', {col})",
|
||||
"P1D": "DATE_TRUNC('day', {col})",
|
||||
"P1W": "DATE_TRUNC('week', {col})",
|
||||
"P1M": "DATE_TRUNC('month', {col})",
|
||||
"P0.25Y": "DATE_TRUNC('quarter', {col})",
|
||||
"P1Y": "DATE_TRUNC('year', {col})",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -49,11 +49,11 @@ class PostgresBaseEngineSpec(BaseEngineSpec):
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
return "'{}'".format(dttm.strftime("%Y-%m-%d %H:%M:%S"))
|
||||
|
||||
|
||||
class PostgresEngineSpec(PostgresBaseEngineSpec):
|
||||
engine = 'postgresql'
|
||||
engine = "postgresql"
|
||||
max_column_name_length = 63
|
||||
try_remove_schema_from_table_name = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user