soda-sqlserver 4.19.0__tar.gz → 4.20.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soda-sqlserver
3
- Version: 4.19.0
3
+ Version: 4.20.0
4
4
  Summary: Soda SQL Server V4
5
5
  Author-email: "Soda Data N.V." <info@soda.io>
6
6
  License: Proprietary
7
7
  Requires-Python: >=3.10
8
- Requires-Dist: soda-core==4.19.0
8
+ Requires-Dist: soda-core==4.20.0
9
9
  Requires-Dist: pyodbc
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "soda-sqlserver"
3
- version = "4.19.0"
3
+ version = "4.20.0"
4
4
  description = "Soda SQL Server V4"
5
5
  requires-python = ">=3.10"
6
6
  license = {text = "Proprietary"}
@@ -8,7 +8,7 @@ authors = [
8
8
  {name = "Soda Data N.V.", email = "info@soda.io"}
9
9
  ]
10
10
  dependencies = [
11
- "soda-core==4.19.0",
11
+ "soda-core==4.20.0",
12
12
  "pyodbc",
13
13
  ]
14
14
 
@@ -30,7 +30,6 @@ from soda_core.common.sql_ast import (
30
30
  LENGTH,
31
31
  LIMIT,
32
32
  OFFSET,
33
- ORDER_BY_ASC,
34
33
  PERCENTILE_WITHIN_GROUP,
35
34
  RANDOM,
36
35
  REGEX_LIKE,
@@ -121,6 +120,11 @@ class SqlServerSqlDialect(SqlDialect, sqlglot_dialect="tsql"):
121
120
  self.server_major_version: Optional[int] = None
122
121
  self.engine_edition: Optional[int] = None
123
122
 
123
+ def supports_primary_keys(self) -> bool:
124
+ # SQL Server enforces primary keys and reports them through the standard
125
+ # information_schema constraint views, with the standard PRIMARY KEY (...) DDL.
126
+ return True
127
+
124
128
  def _build_stddev_samp_sql(self, stddev_samp) -> str:
125
129
  # T-SQL names the sample standard deviation aggregate STDEV.
126
130
  return f"STDEV({self.build_expression_sql(stddev_samp.expression)})"
@@ -330,6 +334,7 @@ class SqlServerSqlDialect(SqlDialect, sqlglot_dialect="tsql"):
330
334
  order_by: list[str],
331
335
  limit: int,
332
336
  offset: int,
337
+ normalize_key_columns: frozenset[str] = frozenset(),
333
338
  ) -> str:
334
339
  where_clauses = []
335
340
 
@@ -340,7 +345,7 @@ class SqlServerSqlDialect(SqlDialect, sqlglot_dialect="tsql"):
340
345
  SELECT(columns or [STAR()]),
341
346
  FROM(table_name=dataset_identifier.dataset_name, table_prefix=dataset_identifier.prefixes),
342
347
  WHERE.optional(AND.optional(where_clauses)),
343
- *[ORDER_BY_ASC(c) for c in order_by],
348
+ *[term for c in order_by for term in self._order_by_key(c, normalize_key_columns)],
344
349
  OFFSET(offset),
345
350
  LIMIT(limit),
346
351
  ]
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soda-sqlserver
3
- Version: 4.19.0
3
+ Version: 4.20.0
4
4
  Summary: Soda SQL Server V4
5
5
  Author-email: "Soda Data N.V." <info@soda.io>
6
6
  License: Proprietary
7
7
  Requires-Python: >=3.10
8
- Requires-Dist: soda-core==4.19.0
8
+ Requires-Dist: soda-core==4.20.0
9
9
  Requires-Dist: pyodbc
@@ -0,0 +1,2 @@
1
+ soda-core==4.20.0
2
+ pyodbc
@@ -1,2 +0,0 @@
1
- soda-core==4.19.0
2
- pyodbc