soda-sqlserver 4.2.0__tar.gz → 4.7.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.2.0
3
+ Version: 4.7.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.2.0
8
+ Requires-Dist: soda-core==4.7.0
9
9
  Requires-Dist: pyodbc
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "soda-sqlserver"
3
- version = "4.2.0"
3
+ version = "4.7.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.2.0",
11
+ "soda-core==4.7.0",
12
12
  "pyodbc",
13
13
  ]
14
14
 
@@ -29,6 +29,7 @@ from soda_core.common.sql_ast import (
29
29
  LIMIT,
30
30
  OFFSET,
31
31
  ORDER_BY_ASC,
32
+ RANDOM,
32
33
  REGEX_LIKE,
33
34
  SELECT,
34
35
  STAR,
@@ -425,3 +426,6 @@ class SqlServerSqlDialect(SqlDialect, sqlglot_dialect="tsql"):
425
426
  # Drop the first prefix (database name) from the fully qualified view name
426
427
  create_view_copy.fully_qualified_view_name = ".".join(create_view_copy.fully_qualified_view_name.split(".")[1:])
427
428
  return super().build_create_view_sql(create_view_copy, add_semicolon, add_parenthesis=False)
429
+
430
+ def _build_random_sql(self, random: RANDOM) -> str:
431
+ return "ABS(CAST(CHECKSUM(NEWID()) AS FLOAT)) / 2147483648.0"
@@ -4,7 +4,7 @@ import logging
4
4
  import struct
5
5
  from abc import ABC
6
6
  from datetime import datetime, timedelta, timezone
7
- from typing import Literal, Optional, Union
7
+ from typing import Any, Literal, Optional, Union
8
8
 
9
9
  import pyodbc
10
10
  from pydantic import Field, SecretStr
@@ -109,6 +109,13 @@ class SqlServerDataSourceConnection(DataSourceConnection):
109
109
  def __init__(self, name: str, connection_properties: DataSourceConnectionProperties):
110
110
  super().__init__(name, connection_properties)
111
111
 
112
+ # Normalize pyodbc.Row objects so downstream consumers see plain tuples.
113
+ def _format_rows(self, rows: list[tuple]) -> list[tuple]:
114
+ return [self._format_row(row) for row in rows]
115
+
116
+ def _format_row(self, row: Any) -> tuple:
117
+ return tuple(row)
118
+
112
119
  def build_connection_string(self, config: SqlServerConnectionProperties):
113
120
  conn_params = []
114
121
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soda-sqlserver
3
- Version: 4.2.0
3
+ Version: 4.7.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.2.0
8
+ Requires-Dist: soda-core==4.7.0
9
9
  Requires-Dist: pyodbc
@@ -0,0 +1,2 @@
1
+ soda-core==4.7.0
2
+ pyodbc
@@ -1,2 +0,0 @@
1
- soda-core==4.2.0
2
- pyodbc
File without changes