pgbelt 0.7.10__tar.gz → 0.7.11__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. {pgbelt-0.7.10 → pgbelt-0.7.11}/PKG-INFO +1 -1
  2. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/postgres.py +28 -6
  3. {pgbelt-0.7.10 → pgbelt-0.7.11}/pyproject.toml +1 -1
  4. {pgbelt-0.7.10 → pgbelt-0.7.11}/LICENSE +0 -0
  5. {pgbelt-0.7.10 → pgbelt-0.7.11}/README.md +0 -0
  6. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/__init__.py +0 -0
  7. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/__init__.py +0 -0
  8. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/convenience.py +0 -0
  9. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/helpers.py +0 -0
  10. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/login.py +0 -0
  11. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/preflight.py +0 -0
  12. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/schema.py +0 -0
  13. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/setup.py +0 -0
  14. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/status.py +0 -0
  15. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/sync.py +0 -0
  16. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/cmd/teardown.py +0 -0
  17. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/config/__init__.py +0 -0
  18. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/config/config.py +0 -0
  19. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/config/models.py +0 -0
  20. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/config/remote.py +0 -0
  21. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/main.py +0 -0
  22. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/__init__.py +0 -0
  23. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/asyncfuncs.py +0 -0
  24. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/dump.py +0 -0
  25. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/logs.py +0 -0
  26. {pgbelt-0.7.10 → pgbelt-0.7.11}/pgbelt/util/pglogical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pgbelt
3
- Version: 0.7.10
3
+ Version: 0.7.11
4
4
  Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
5
5
  Author: Varjitt Jeeva
6
6
  Author-email: varjitt.jeeva@autodesk.com
@@ -1,5 +1,6 @@
1
1
  from logging import Logger
2
2
 
3
+ from decimal import Decimal
3
4
  from asyncpg import Pool
4
5
  from asyncpg import Record
5
6
  from asyncpg.exceptions import UndefinedObjectError
@@ -171,12 +172,33 @@ async def compare_data(
171
172
  # Check each row for exact match
172
173
  for src_row, dst_row in zip(src_rows, dst_rows):
173
174
  if src_row != dst_row:
174
- raise AssertionError(
175
- "Row match failure between source and destination.\n"
176
- f"Table: {full_table_name}\n"
177
- f"Source Row: {src_row}\n"
178
- f"Dest Row: {dst_row}"
179
- )
175
+
176
+ # Addresses #571, AsyncPG is decoding numeric NaN as Python Decimal('NaN').
177
+ # Decimal('NaN') != Decimal('NaN'), breaks comparison. Convert those NaNs to None.
178
+ src_row_d = {
179
+ key: (
180
+ value
181
+ if not (isinstance(value, Decimal) and value.is_nan())
182
+ else None
183
+ )
184
+ for key, value in row.items()
185
+ }
186
+ dst_row_d = {
187
+ key: (
188
+ value
189
+ if not (isinstance(value, Decimal) and value.is_nan())
190
+ else None
191
+ )
192
+ for key, value in row.items()
193
+ }
194
+
195
+ if src_row_d != dst_row_d:
196
+ raise AssertionError(
197
+ "Row match failure between source and destination.\n"
198
+ f"Table: {full_table_name}\n"
199
+ f"Source Row: {src_row}\n"
200
+ f"Dest Row: {dst_row}"
201
+ )
180
202
 
181
203
  # Just a paranoia check. If this throws, then it's possible pgbelt didn't migrate any data.
182
204
  # This was found in issue #420, and previous commands threw errors before this issue could arise.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pgbelt"
3
- version = "0.7.10"
3
+ version = "0.7.11"
4
4
  description = "A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication."
5
5
  authors = ["Varjitt Jeeva <varjitt.jeeva@autodesk.com>"]
6
6
  readme = "README.md"
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
File without changes
File without changes
File without changes