Skip to content

Commit

Permalink
Fix the timezone format for Apache Arrow (pyarrow)
Browse files Browse the repository at this point in the history
As noted by @ensky in apache#20155 the format returned by Postgres' DATE_TRUNC is not compatible (any more?). This is a quick fix that works for me.
  • Loading branch information
fmos authored Jun 2, 2022
1 parent bd71e75 commit 0b49ca6
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 @@ -84,14 +84,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})||':00'",
"PT1M": "DATE_TRUNC('minute', {col})||':00'",
"PT1H": "DATE_TRUNC('hour', {col})||':00'",
"P1D": "DATE_TRUNC('day', {col})||':00'",
"P1W": "DATE_TRUNC('week', {col})||':00'",
"P1M": "DATE_TRUNC('month', {col})||':00'",
"P3M": "DATE_TRUNC('quarter', {col})||':00'",
"P1Y": "DATE_TRUNC('year', {col})||':00'",
}

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

0 comments on commit 0b49ca6

Please sign in to comment.