Skip to content

Commit

Permalink
Fix backup processor
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Sep 22, 2024
1 parent f01c16d commit e7275bd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions operators/backup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@
]

def backup():
DF.Flow(
*[
for b, t in TABLES_TO_BACK_UP:
DF.Flow(
load_from_airtable(
b, t, settings.AIRTABLE_VIEW, settings.AIRTABLE_API_KEY
)
for b, t in TABLES_TO_BACK_UP
),
DF.dump_to_path(f'backup/{t}')
).process()

DF.Flow(
*[
DF.load(f'backup/{t}/datapackage.json'),
for _, t in TABLES_TO_BACK_UP
],
DF.validate(),
DF.update_package(title='Manual Input Backup', name='backup'),
dump_to_ckan(
settings.CKAN_HOST,
settings.CKAN_API_KEY,
settings.CKAN_OWNER_ORG,
),
),
).process()


def operator(*_):
backup()

Expand Down

0 comments on commit e7275bd

Please sign in to comment.