Skip to content

Commit

Permalink
Fix the timezone format for Apache Arrow (pyarrow)
Browse files Browse the repository at this point in the history
This is an update of my previous patch 0b49ca6 to make the format returned by Postgres' DATE_TRUNC compatible with pyarrow (used for calling prophet).
  • Loading branch information
fmos authored Sep 21, 2022
1 parent 4d12e37 commit c61ac76
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions superset/db_engine_specs/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ class PostgresBaseEngineSpec(BaseEngineSpec):

_time_grain_expressions = {
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})",
"P3M": "DATE_TRUNC('quarter', {col})",
"P1Y": "DATE_TRUNC('year', {col})",
"PT1S": "DATE_TRUNC('second', {col})::timestamp",
"PT1M": "DATE_TRUNC('minute', {col})::timestamp",
"PT1H": "DATE_TRUNC('hour', {col})::timestamp",
"P1D": "DATE_TRUNC('day', {col})::timestamp",
"P1W": "DATE_TRUNC('week', {col})::timestamp",
"P1M": "DATE_TRUNC('month', {col})::timestamp",
"P3M": "DATE_TRUNC('quarter', {col})::timestamp",
"P1Y": "DATE_TRUNC('year', {col})::timestamp",
}

custom_errors: Dict[Pattern[str], Tuple[str, SupersetErrorType, Dict[str, Any]]] = {
Expand Down

0 comments on commit c61ac76

Please sign in to comment.