Skip to content

Strange behavior when downloading OECD23 multiple times #156

@spjuhel

Description

@spjuhel

Running download_oecd for OECDv23 multiple times weirdly renames files within the download folder (with and without overwriting=True). See example below.

I assume there is a problem in the renaming after the extraction of the downloaded zip file here:

if version == "v2023":
for file in os.listdir(storage_folder):
absolute_path = os.path.join(storage_folder, file)
os.rename(
os.path.join(storage_folder, file),
os.path.join(
storage_folder,
"ICIO2023_" + file.replace("_SML", ""),
),
)

download_oecd("~/downloads", years="1995-2000")

contents of "~/downloads":

download_log.json
ICIO2023_1995.csv
ICIO2023_1996.csv
ICIO2023_1998.csv
ICIO2023_1997.csv
ICIO2023_1999.csv
ICIO2023_2000.csv

Running it again:

download_oecd("~/downloads", years="1995-2000")

contents of "~/downloads":

download_log.json
ICIO2023_download_log.json
ICIO2023_1996.csv
ICIO2023_ICIO2023_1997.csv
ICIO2023_ICIO2023_1996.csv
ICIO2023_ICIO2023_1999.csv
ICIO2023_ICIO2023_1995.csv
ICIO2023_ICIO2023_1998.csv
ICIO2023_1999.csv
ICIO2023_1996.csv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions