macrostrat.database 4.2.0__tar.gz → 4.2.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 (18) hide show
  1. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/PKG-INFO +1 -1
  2. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/query.py +12 -7
  3. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/pyproject.toml +1 -1
  4. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/.DS_Store +0 -0
  5. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/__init__.py +0 -0
  6. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/compat.py +0 -0
  7. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/mapper/__init__.py +0 -0
  8. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/mapper/base.py +0 -0
  9. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/mapper/cache.py +0 -0
  10. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/mapper/utils.py +0 -0
  11. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/postgresql.py +0 -0
  12. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/__init__.py +0 -0
  13. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/dump_database.py +0 -0
  14. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/move_tables.py +0 -0
  15. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/restore_database.py +0 -0
  16. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/stream_utils.py +0 -0
  17. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/transfer/utils.py +0 -0
  18. {macrostrat_database-4.2.0 → macrostrat_database-4.2.1}/macrostrat/database/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: macrostrat.database
3
- Version: 4.2.0
3
+ Version: 4.2.1
4
4
  Summary: A SQLAlchemy-based database toolkit.
5
5
  Author: Daven Quinn
6
6
  Author-email: Daven Quinn <dev@davenquinn.com>
@@ -10,10 +10,6 @@ from warnings import warn
10
10
 
11
11
  import psycopg2.sql as psql2
12
12
  from click import secho
13
- from macrostrat.database.compat import (
14
- update_legacy_identifier,
15
- )
16
- from macrostrat.utils import get_logger
17
13
  from psycopg.errors import QueryCanceled
18
14
  from psycopg.sql import SQL, Composable, Composed
19
15
  from rich.console import Console
@@ -29,6 +25,11 @@ from sqlalchemy.exc import (
29
25
  from sqlalchemy.sql.elements import TextClause
30
26
  from sqlparse import format, split
31
27
 
28
+ from macrostrat.database.compat import (
29
+ update_legacy_identifier,
30
+ )
31
+ from macrostrat.utils import get_logger
32
+
32
33
  log = get_logger(__name__)
33
34
 
34
35
 
@@ -398,13 +399,15 @@ def _execute_one(
398
399
 
399
400
  if result.label is not None:
400
401
  display_text = result.label
402
+ elif output_mode == OutputMode.NONE:
403
+ display_text = None
401
404
  elif output_mode != OutputMode.ALL:
402
405
  display_text = summarize_statement(str(query))
403
406
  else:
404
407
  display_text = str(query)
405
408
 
406
409
  if result.skip:
407
- if print_skipped:
410
+ if print_skipped and display_text is not None:
408
411
  secho(display_text, dim=True, strikethrough=True, file=output_file)
409
412
  return
410
413
 
@@ -430,7 +433,8 @@ def _execute_one(
430
433
  elif hasattr(connectable, "commit"):
431
434
  connectable.commit()
432
435
 
433
- secho(display_text, dim=True, file=output_file)
436
+ if display_text is not None:
437
+ secho(display_text, dim=True, file=output_file)
434
438
 
435
439
  except Exception as err:
436
440
  if trans is not None:
@@ -439,7 +443,8 @@ def _execute_one(
439
443
  connectable.rollback()
440
444
  if raise_errors or _should_raise_query_error(err):
441
445
  raise err
442
- _print_error(display_text, err, file=output_file)
446
+ if display_text is not None:
447
+ _print_error(display_text, err, file=output_file)
443
448
 
444
449
 
445
450
  def _should_raise_query_error(err):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "macrostrat.database"
3
- version = "4.2.0"
3
+ version = "4.2.1"
4
4
  description = "A SQLAlchemy-based database toolkit."
5
5
  authors = [{ name = "Daven Quinn", email = "dev@davenquinn.com" }]
6
6
  requires-python = ">=3.10,<4"