|
54 | 54 | from ..sql.wide import ( |
55 | 55 | create_wide_dataset, |
56 | 56 | physical_name, |
57 | | - read_fidelity_events, |
58 | | - read_wide_dataset, |
| 57 | + _read_fidelity_events, |
| 58 | + _read_snapshot, |
| 59 | + _read_wide_dataset, |
59 | 60 | validate_spss_catalog, |
60 | 61 | ) |
61 | 62 |
|
@@ -556,20 +557,21 @@ def export_sav_dataset( |
556 | 557 | destination_path = Path(destination) |
557 | 558 | if destination_path.suffix.lower() not in {".sav", ".zsav"}: |
558 | 559 | raise UnsupportedOperationError("Export destinations must use the .sav or .zsav extension.") |
559 | | - dataset, variables, rows = read_wide_dataset( |
560 | | - database_url=database_url, dataset_id=dataset_id, |
| 560 | + with _read_snapshot( |
| 561 | + database_url=database_url, |
561 | 562 | dolt_conformance_source=dolt_conformance_source, |
562 | | - ) |
| 563 | + ) as (connection, profile): |
| 564 | + dataset, variables, rows = _read_wide_dataset( |
| 565 | + connection, dataset_id=dataset_id, profile=profile, |
| 566 | + ) |
| 567 | + persisted_events = _read_fidelity_events( |
| 568 | + connection, dataset_id=dataset["dataset_id"], direction="import", |
| 569 | + ) |
563 | 570 | validate_spss_catalog( |
564 | 571 | variables, |
565 | 572 | case_weight_variable=dataset.get("case_weight_variable"), |
566 | 573 | multiple_response_sets=dataset.get("multiple_response_sets"), |
567 | 574 | ) |
568 | | - persisted_events = read_fidelity_events( |
569 | | - database_url=database_url, dataset_id=dataset_id, |
570 | | - direction="import", |
571 | | - dolt_conformance_source=dolt_conformance_source, |
572 | | - ) |
573 | 575 | if legacy_locale is not None: |
574 | 576 | persisted_events = tuple( |
575 | 577 | event for event in persisted_events |
|
0 commit comments