altcodepro-polydb-python 2.5.3__tar.gz → 2.5.4__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 (101) hide show
  1. {altcodepro_polydb_python-2.5.3/src/altcodepro_polydb_python.egg-info → altcodepro_polydb_python-2.5.4}/PKG-INFO +1 -1
  2. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/pyproject.toml +1 -1
  3. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4/src/altcodepro_polydb_python.egg-info}/PKG-INFO +1 -1
  4. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/AzureTableStorageAdapter.py +32 -5
  5. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/LICENSE +0 -0
  6. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/MANIFEST.in +0 -0
  7. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/README.md +0 -0
  8. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements-aws.txt +0 -0
  9. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements-azure.txt +0 -0
  10. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements-dev.txt +0 -0
  11. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements-gcp.txt +0 -0
  12. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements-generic.txt +0 -0
  13. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/requirements.txt +0 -0
  14. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/setup.cfg +0 -0
  15. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/setup.py +0 -0
  16. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/altcodepro_polydb_python.egg-info/SOURCES.txt +0 -0
  17. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/altcodepro_polydb_python.egg-info/dependency_links.txt +0 -0
  18. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/altcodepro_polydb_python.egg-info/requires.txt +0 -0
  19. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/altcodepro_polydb_python.egg-info/top_level.txt +0 -0
  20. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/PolyDB.py +0 -0
  21. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/__init__.py +0 -0
  22. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/AzureBlobStorageAdapter.py +0 -0
  23. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/AzureFileStorageAdapter.py +0 -0
  24. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/AzureQueueAdapter.py +0 -0
  25. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/BlockchainBlobAdapter.py +0 -0
  26. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/BlockchainFileAdapter.py +0 -0
  27. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/BlockchainKVAdapter.py +0 -0
  28. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/BlockchainQueueAdapter.py +0 -0
  29. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/DynamoDBAdapter.py +0 -0
  30. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/EFSAdapter.py +0 -0
  31. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/FirestoreAdapter.py +0 -0
  32. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/GCPFilestoreAdapter.py +0 -0
  33. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/GCPPubSubAdapter.py +0 -0
  34. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/GCPStorageAdapter.py +0 -0
  35. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/MongoDBAdapter.py +0 -0
  36. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/PostgreSQLAdapter.py +0 -0
  37. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/S3Adapter.py +0 -0
  38. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/S3CompatibleAdapter.py +0 -0
  39. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/SQSAdapter.py +0 -0
  40. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/VercelBlobAdapter.py +0 -0
  41. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/VercelFileAdapter.py +0 -0
  42. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/VercelKVAdapter.py +0 -0
  43. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/VercelQueueAdapter.py +0 -0
  44. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/adapters/__init__.py +0 -0
  45. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/advanced_query.py +0 -0
  46. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/audit/AuditStorage.py +0 -0
  47. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/audit/__init__.py +0 -0
  48. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/audit/context.py +0 -0
  49. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/audit/manager.py +0 -0
  50. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/audit/models.py +0 -0
  51. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/base/NoSQLKVAdapter.py +0 -0
  52. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/base/ObjectStorageAdapter.py +0 -0
  53. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/base/QueueAdapter.py +0 -0
  54. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/base/SharedFilesAdapter.py +0 -0
  55. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/base/__init__.py +0 -0
  56. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/batch.py +0 -0
  57. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/cache.py +0 -0
  58. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/cloudDatabaseFactory.py +0 -0
  59. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/databaseFactory.py +0 -0
  60. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/decorators.py +0 -0
  61. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/errors.py +0 -0
  62. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/json_safe.py +0 -0
  63. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/models.py +0 -0
  64. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/monitoring.py +0 -0
  65. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/multitenancy.py +0 -0
  66. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/observability/__init__.py +0 -0
  67. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/observability/logging.py +0 -0
  68. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/py.typed +0 -0
  69. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/query.py +0 -0
  70. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/registry.py +0 -0
  71. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/retry.py +0 -0
  72. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/schema.py +0 -0
  73. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/security.py +0 -0
  74. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/services/__init__.py +0 -0
  75. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/services/compliance_service.py +0 -0
  76. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/services/security_service.py +0 -0
  77. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/types.py +0 -0
  78. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/utils.py +0 -0
  79. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/src/polydb/validation.py +0 -0
  80. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_advanced_query_injection.py +0 -0
  81. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_atomic_decrement.py +0 -0
  82. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_audit_chain_cutover.py +0 -0
  83. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_audit_hmac.py +0 -0
  84. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_aws.py +0 -0
  85. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_azure.py +0 -0
  86. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_azure_queue_receipt_handle.py +0 -0
  87. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_azure_table_empty_filter.py +0 -0
  88. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_azure_table_unpack_entity.py +0 -0
  89. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_blockchain.py +0 -0
  90. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_cloud_factory.py +0 -0
  91. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_field_encryption.py +0 -0
  92. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_gcp.py +0 -0
  93. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_like_pattern_escaping.py +0 -0
  94. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_mongodb.py +0 -0
  95. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_multi_engine.py +0 -0
  96. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_multitenancy_ddl_injection.py +0 -0
  97. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_nosql_operator_injection.py +0 -0
  98. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_observability.py +0 -0
  99. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_postgresql.py +0 -0
  100. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_schema_ddl_injection.py +0 -0
  101. {altcodepro_polydb_python-2.5.3 → altcodepro_polydb_python-2.5.4}/tests/test_vercel.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.5.3
3
+ Version: 2.5.4
4
4
  Summary: Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety
5
5
  Author: AltCodePro
6
6
  Project-URL: Homepage, https://github.com/altcodepro/polydb-python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "altcodepro-polydb-python"
7
- version = "2.5.3"
7
+ version = "2.5.4"
8
8
  description = "Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.5.3
3
+ Version: 2.5.4
4
4
  Summary: Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety
5
5
  Author: AltCodePro
6
6
  Project-URL: Homepage, https://github.com/altcodepro/polydb-python
@@ -24,6 +24,16 @@ from ..models import PageResult, PartitionConfig
24
24
 
25
25
  logger = logging.getLogger(__name__)
26
26
 
27
+ # Imported at module scope (unlike the clients, which stay lazy) because these
28
+ # are pure value types with no connection cost, and both the encode and decode
29
+ # paths need them per field. Guarded so importing polydb without the azure
30
+ # extra still works -- in that state nothing in this adapter functions anyway.
31
+ try:
32
+ from azure.data.tables import EdmType, EntityProperty
33
+ except ImportError: # pragma: no cover - azure extra not installed
34
+ EdmType = None # type: ignore[assignment]
35
+ EntityProperty = None # type: ignore[assignment]
36
+
27
37
  _BYTES_PREFIX = "@@polydb_bytes@@:"
28
38
  _JSON_PREFIX = "@@polydb_json@@:"
29
39
  _BASE64_RE = re.compile(r"^[A-Za-z0-9+/]*={0,2}$")
@@ -155,15 +165,25 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
155
165
 
156
166
  if isinstance(v, datetime):
157
167
  return v
158
- if isinstance(v, int):
168
+ if isinstance(v, int) and not isinstance(v, bool):
159
169
  # Azure Table Int32 range: -2_147_483_648 … 2_147_483_647
160
170
  if -2_147_483_648 <= v <= 2_147_483_647:
161
171
  return v
162
- # Outside Int32 → force Int64-compatible representation
163
- # The Azure SDK accepts Python ints larger than Int32 and stores them as Edm.Int64
164
- # when they fit in 64 bits. For values that exceed even Int64 we fall back to string.
172
+ # Outside Int32 → must be tagged Edm.Int64 EXPLICITLY.
173
+ #
174
+ # Returning the bare int here does NOT work, despite reading like
175
+ # it should: the SDK's _add_entity_properties dispatches on
176
+ # type(value), and every Python int maps to _to_entity_int32,
177
+ # which raises "<n> is too large to be cast to type EdmType.INT32"
178
+ # for anything >= 2**31. It never infers Int64. The one documented
179
+ # way to reach Edm.Int64 is an EntityProperty tuple -- the
180
+ # serializer branches on isinstance(value, tuple) and takes the
181
+ # edm_type from element 1 -- so that is what we hand it.
182
+ # _decode_value unwraps the same shape on the way back out.
165
183
  if -9_223_372_036_854_775_808 <= v <= 9_223_372_036_854_775_807:
166
- return v # will be stored as Edm.Int64
184
+ if EntityProperty is not None and EdmType is not None:
185
+ return EntityProperty(v, EdmType.INT64)
186
+ return str(v)
167
187
  return str(v) # safety net for arbitrarily large ints
168
188
  if isinstance(v, (str, bool, int, float)):
169
189
  return v
@@ -171,6 +191,13 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
171
191
  return _JSON_PREFIX + json.dumps(v, default=json_safe)
172
192
 
173
193
  def _decode_value(self, v: Any) -> Any:
194
+ # Edm.Int64 comes back as EntityProperty(value, EdmType.INT64), not as
195
+ # a plain int -- the SDK's _from_entity_int64 wraps it. Unwrap here so
196
+ # a large int round-trips as the int that was written; left alone it
197
+ # would surface to callers as a 2-tuple and, on the next write, be
198
+ # JSON-encoded by the list/tuple branch of _encode_value.
199
+ if EntityProperty is not None and isinstance(v, EntityProperty):
200
+ return v.value
174
201
  if isinstance(v, str):
175
202
  if v.startswith(_JSON_PREFIX):
176
203
  payload = v[len(_JSON_PREFIX) :]