fakesnow 0.9.0__tar.gz → 0.9.1__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 (29) hide show
  1. {fakesnow-0.9.0/fakesnow.egg-info → fakesnow-0.9.1}/PKG-INFO +1 -1
  2. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/fakes.py +5 -0
  3. {fakesnow-0.9.0 → fakesnow-0.9.1/fakesnow.egg-info}/PKG-INFO +1 -1
  4. {fakesnow-0.9.0 → fakesnow-0.9.1}/pyproject.toml +1 -1
  5. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_fakes.py +13 -0
  6. {fakesnow-0.9.0 → fakesnow-0.9.1}/LICENSE +0 -0
  7. {fakesnow-0.9.0 → fakesnow-0.9.1}/MANIFEST.in +0 -0
  8. {fakesnow-0.9.0 → fakesnow-0.9.1}/README.md +0 -0
  9. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/__init__.py +0 -0
  10. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/__main__.py +0 -0
  11. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/checks.py +0 -0
  12. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/cli.py +0 -0
  13. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/expr.py +0 -0
  14. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/fixtures.py +0 -0
  15. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/info_schema.py +0 -0
  16. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/macros.py +0 -0
  17. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/py.typed +0 -0
  18. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow/transforms.py +0 -0
  19. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow.egg-info/SOURCES.txt +0 -0
  20. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow.egg-info/dependency_links.txt +0 -0
  21. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow.egg-info/entry_points.txt +0 -0
  22. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow.egg-info/requires.txt +0 -0
  23. {fakesnow-0.9.0 → fakesnow-0.9.1}/fakesnow.egg-info/top_level.txt +0 -0
  24. {fakesnow-0.9.0 → fakesnow-0.9.1}/setup.cfg +0 -0
  25. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_checks.py +0 -0
  26. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_cli.py +0 -0
  27. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_expr.py +0 -0
  28. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_patch.py +0 -0
  29. {fakesnow-0.9.0 → fakesnow-0.9.1}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fakesnow
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -39,6 +39,7 @@ SQL_CREATED_TABLE = Template("SELECT 'Table ${name} successfully created.' as 's
39
39
  SQL_DROPPED = Template("SELECT '${name} successfully dropped.' as 'status'")
40
40
  SQL_INSERTED_ROWS = Template("SELECT ${count} as 'number of rows inserted'")
41
41
  SQL_UPDATED_ROWS = Template("SELECT ${count} as 'number of rows updated', 0 as 'number of multi-joined rows updated'")
42
+ SQL_DELETED_ROWS = Template("SELECT ${count} as 'number of rows deleted'")
42
43
 
43
44
 
44
45
  class FakeSnowflakeCursor:
@@ -265,6 +266,10 @@ class FakeSnowflakeCursor:
265
266
  (affected_count,) = self._duck_conn.fetchall()[0]
266
267
  result_sql = SQL_UPDATED_ROWS.substitute(count=affected_count)
267
268
 
269
+ elif cmd == "DELETE":
270
+ (affected_count,) = self._duck_conn.fetchall()[0]
271
+ result_sql = SQL_DELETED_ROWS.substitute(count=affected_count)
272
+
268
273
  elif cmd == "DESCRIBE TABLE":
269
274
  # DESCRIBE TABLE has already been run above to detect and error if the table exists
270
275
  # We now rerun DESCRIBE TABLE but transformed with columns to match Snowflake
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fakesnow
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "fakesnow"
3
3
  description = "Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally."
4
- version = "0.9.0"
4
+ version = "0.9.1"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
7
7
  classifiers = ["License :: OSI Approved :: MIT License"]
@@ -459,6 +459,19 @@ def test_description_update(dcur: snowflake.connector.cursor.DictCursor):
459
459
  # fmt: on
460
460
 
461
461
 
462
+ def test_description_delete(dcur: snowflake.connector.cursor.DictCursor):
463
+ dcur.execute("create table example (x int)")
464
+ dcur.execute("insert into example values (1), (2), (3)")
465
+ dcur.execute("delete from example where x>1")
466
+ assert dcur.fetchall() == [{"number of rows deleted": 2}]
467
+ # TODO: Snowflake is actually precision=19, is_nullable=False
468
+ # fmt: off
469
+ assert dcur.description == [
470
+ ResultMetadata(name='number of rows deleted', type_code=0, display_size=None, internal_size=None, precision=38, scale=0, is_nullable=True),
471
+ ]
472
+ # fmt: on
473
+
474
+
462
475
  def test_equal_null(cur: snowflake.connector.cursor.SnowflakeCursor):
463
476
  cur.execute("select equal_null(NULL, NULL), equal_null(1, 1), equal_null(1, 2), equal_null(1, NULL)")
464
477
  assert cur.fetchall() == [(True, True, False, False)]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes