Skip to content

Commit

Permalink
remove nulls last syntax for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
pblankley committed Feb 24, 2025
1 parent e586de3 commit 50e47d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
13 changes: 4 additions & 9 deletions metrics_layer/core/sql/query_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

PostgreSQLQueryBuilder.ALIAS_QUOTE_CHAR = None
PostgreSQLQueryBuilder.QUOTE_CHAR = None
MySQLQueryBuilder.ALIAS_QUOTE_CHAR = None
MySQLQueryBuilder.QUOTE_CHAR = None


class NullSorting(Enum):
Expand Down Expand Up @@ -138,15 +140,8 @@ class MySQLQuery(Query):
"""

@classmethod
def _builder(cls, **kwargs) -> "MySQLQueryBuilderWithOrderByNullsOption":
return MySQLQueryBuilderWithOrderByNullsOption(**kwargs)


class MySQLQueryBuilderWithOrderByNullsOption(QueryBuilderWithOrderByNullsOption):
QUOTE_CHAR = None
ALIAS_QUOTE_CHAR = None
QUERY_ALIAS_QUOTE_CHAR = ""
QUERY_CLS = MySQLQuery
def _builder(cls, **kwargs) -> "MySQLQueryBuilder":
return MySQLQueryBuilder(**kwargs)


class PostgresQuery(Query):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metrics_layer"
version = "0.12.54"
version = "0.12.55"
description = "The open source metrics layer."
authors = ["Paul Blankley <paul@zenlytic.com>"]
keywords = ["Metrics Layer", "Business Intelligence", "Analytics"]
Expand Down
1 change: 0 additions & 1 deletion tests/test_simple_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,6 @@ def test_simple_query_with_order_by_dict(connections, query_type):
Definitions.trino,
Definitions.databricks,
Definitions.bigquery,
Definitions.mysql,
}:
nulls_last = " NULLS LAST"
else:
Expand Down

0 comments on commit 50e47d3

Please sign in to comment.