python-datastore-sqlalchemy 0.0.3__tar.gz → 0.0.5__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.
Files changed (26) hide show
  1. {python_datastore_sqlalchemy-0.0.3/python_datastore_sqlalchemy.egg-info → python_datastore_sqlalchemy-0.0.5}/PKG-INFO +6 -3
  2. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/README.md +1 -1
  3. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/pyproject.toml +5 -2
  4. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5/python_datastore_sqlalchemy.egg-info}/PKG-INFO +6 -3
  5. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/__init__.py +1 -1
  6. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/base.py +9 -2
  7. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_integration_queries.py +12 -6
  8. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_unit_types.py +8 -1
  9. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/LICENSE +0 -0
  10. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/python_datastore_sqlalchemy.egg-info/SOURCES.txt +0 -0
  11. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/python_datastore_sqlalchemy.egg-info/dependency_links.txt +0 -0
  12. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/python_datastore_sqlalchemy.egg-info/entry_points.txt +0 -0
  13. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/python_datastore_sqlalchemy.egg-info/requires.txt +0 -0
  14. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/python_datastore_sqlalchemy.egg-info/top_level.txt +0 -0
  15. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/setup.cfg +0 -0
  16. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/setup.py +0 -0
  17. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/_helpers.py +0 -0
  18. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/_types.py +0 -0
  19. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/datastore_dbapi.py +0 -0
  20. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/sqlalchemy_datastore/parse_url.py +0 -0
  21. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_datastore.py +0 -0
  22. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_gql.py +0 -0
  23. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_orm.py +0 -0
  24. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_unit_base.py +0 -0
  25. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_unit_dbapi.py +0 -0
  26. {python_datastore_sqlalchemy-0.0.3 → python_datastore_sqlalchemy-0.0.5}/tests/test_unit_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-datastore-sqlalchemy
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: SQLAlchemy dialect for google cloud datastore
5
5
  Author-email: "HY Chang(splasky)" <hychang.1997.tw@gmail.com>
6
6
  License: MIT
@@ -12,10 +12,13 @@ Classifier: Development Status :: 2 - Pre-Alpha
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
15
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
16
19
  Classifier: Topic :: Database :: Front-Ends
17
20
  Classifier: Operating System :: POSIX :: Linux
18
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
19
22
  Description-Content-Type: text/markdown
20
23
  License-File: LICENSE
21
24
  Requires-Dist: sqlalchemy<3.0.0,>=1.4.16
@@ -73,7 +76,7 @@ Feel free to open issues and pull requests on GitHub.
73
76
 
74
77
  ## Development
75
78
 
76
- This project supports Python 3.10 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
79
+ This project supports Python 3.11 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
77
80
 
78
81
  Install the development environment:
79
82
  ```bash
@@ -43,7 +43,7 @@ Feel free to open issues and pull requests on GitHub.
43
43
 
44
44
  ## Development
45
45
 
46
- This project supports Python 3.10 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
46
+ This project supports Python 3.11 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
47
47
 
48
48
  Install the development environment:
49
49
  ```bash
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-datastore-sqlalchemy"
7
- version = "0.0.3"
7
+ version = "0.0.5"
8
8
  description = "SQLAlchemy dialect for google cloud datastore"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = { text = "MIT" }
12
12
  authors = [
13
13
  { name = "HY Chang(splasky)", email = "hychang.1997.tw@gmail.com" },
@@ -17,6 +17,9 @@ classifiers = [
17
17
  "Intended Audience :: Developers",
18
18
  "Programming Language :: Python",
19
19
  "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
20
23
  "Programming Language :: Python :: Implementation :: CPython",
21
24
  "Topic :: Database :: Front-Ends",
22
25
  "Operating System :: POSIX :: Linux",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-datastore-sqlalchemy
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: SQLAlchemy dialect for google cloud datastore
5
5
  Author-email: "HY Chang(splasky)" <hychang.1997.tw@gmail.com>
6
6
  License: MIT
@@ -12,10 +12,13 @@ Classifier: Development Status :: 2 - Pre-Alpha
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
15
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
16
19
  Classifier: Topic :: Database :: Front-Ends
17
20
  Classifier: Operating System :: POSIX :: Linux
18
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
19
22
  Description-Content-Type: text/markdown
20
23
  License-File: LICENSE
21
24
  Requires-Dist: sqlalchemy<3.0.0,>=1.4.16
@@ -73,7 +76,7 @@ Feel free to open issues and pull requests on GitHub.
73
76
 
74
77
  ## Development
75
78
 
76
- This project supports Python 3.10 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
79
+ This project supports Python 3.11 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
77
80
 
78
81
  Install the development environment:
79
82
  ```bash
@@ -19,7 +19,7 @@
19
19
 
20
20
  from .base import CloudDatastoreDialect
21
21
 
22
- __version__ = "0.0.3"
22
+ __version__ = "0.0.5"
23
23
 
24
24
  __all__ = [
25
25
  "__version__",
@@ -20,6 +20,7 @@ import logging
20
20
  from typing import Any, List, Optional
21
21
 
22
22
  from google.cloud import firestore_admin_v1
23
+ from google.cloud.datastore.query import PropertyFilter
23
24
  from google.oauth2 import service_account
24
25
  from sqlalchemy import exc
25
26
  from sqlalchemy.engine import Connection, default
@@ -54,6 +55,7 @@ class CloudDatastoreDialect(default.DefaultDialect):
54
55
  supports_unicode_binds = True
55
56
  returns_unicode_strings = True
56
57
  description_encoding = None
58
+ supports_statement_cache = False
57
59
 
58
60
  # JSON support - required for SQLAlchemy JSON type
59
61
  _json_serializer = None
@@ -88,10 +90,15 @@ class CloudDatastoreDialect(default.DefaultDialect):
88
90
  self._client = None
89
91
 
90
92
  @classmethod
91
- def dbapi(cls):
93
+ def import_dbapi(cls):
92
94
  """Return the DBAPI 2.0 driver."""
93
95
  return datastore_dbapi
94
96
 
97
+ @classmethod
98
+ def dbapi(cls):
99
+ """Return the DBAPI 2.0 driver."""
100
+ return cls.import_dbapi()
101
+
95
102
  def do_ping(self, dbapi_connection):
96
103
  """Performs a simple operation to check if the connection is still alive."""
97
104
  try:
@@ -212,7 +219,7 @@ class CloudDatastoreDialect(default.DefaultDialect):
212
219
  """Retrieve column information from the database."""
213
220
  client = self._client
214
221
  query = client.query(kind="__Stat_PropertyType_PropertyName_Kind__")
215
- query.add_filter("kind_name", "=", table_name)
222
+ query.add_filter(filter=PropertyFilter("kind_name", "=", table_name))
216
223
  properties = list(query.fetch())
217
224
 
218
225
  return [
@@ -33,8 +33,10 @@ def test_update_user(conn, datastore_client):
33
33
 
34
34
  # Find the inserted entity by querying the datastore client directly
35
35
  query = datastore_client.query(kind="users")
36
- query.add_filter("name", "=", "UpdateTestUser")
37
- entities = list(query.fetch())
36
+ entities = [
37
+ entity for entity in query.fetch()
38
+ if entity.get("name") == "UpdateTestUser"
39
+ ]
38
40
  assert len(entities) >= 1
39
41
  entity_id = entities[0].key.id
40
42
 
@@ -62,8 +64,10 @@ def test_delete_user(conn, datastore_client):
62
64
 
63
65
  # Find the inserted entity
64
66
  query = datastore_client.query(kind="users")
65
- query.add_filter("name", "=", "DeleteTestUser")
66
- entities = list(query.fetch())
67
+ entities = [
68
+ entity for entity in query.fetch()
69
+ if entity.get("name") == "DeleteTestUser"
70
+ ]
67
71
  assert len(entities) >= 1
68
72
  entity_id = entities[0].key.id
69
73
 
@@ -332,8 +336,10 @@ def test_task_insert_update_delete_raw_sql(conn, datastore_client):
332
336
 
333
337
  # Find the inserted entity
334
338
  query = datastore_client.query(kind="tasks")
335
- query.add_filter("task", "=", "Coverage Test Task")
336
- entities = list(query.fetch())
339
+ entities = [
340
+ entity for entity in query.fetch()
341
+ if entity.get("task") == "Coverage Test Task"
342
+ ]
337
343
  assert len(entities) >= 1
338
344
  entity_id = entities[0].key.id
339
345
 
@@ -17,6 +17,7 @@
17
17
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
18
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
  """Unit tests for _types module (no emulator required)."""
20
+ import pytest
20
21
  import sqlalchemy.types
21
22
  from google.cloud.bigquery.schema import SchemaField
22
23
 
@@ -190,7 +191,13 @@ def test_get_sqla_column_type_repeated():
190
191
 
191
192
  def test_get_sqla_column_type_unknown():
192
193
  field = SchemaField("mystery", "UNKNOWN_TYPE_XYZ")
193
- coltype = _get_sqla_column_type(field)
194
+
195
+ with pytest.warns(
196
+ sqlalchemy.exc.SAWarning,
197
+ match="Did not recognize type 'UNKNOWN_TYPE_XYZ' of column 'mystery'",
198
+ ):
199
+ coltype = _get_sqla_column_type(field)
200
+
194
201
  assert coltype is sqlalchemy.types.NullType
195
202
 
196
203