Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob method for combining multiple zip files in readMultizip in Pega_IO #205

Closed
brianhamnerPega opened this issue Apr 2, 2024 · 0 comments · Fixed by #260
Closed

Glob method for combining multiple zip files in readMultizip in Pega_IO #205

brianhamnerPega opened this issue Apr 2, 2024 · 0 comments · Fixed by #260
Assignees
Labels
enhancement New feature or request

Comments

@brianhamnerPega
Copy link

brianhamnerPega commented Apr 2, 2024

Is your feature request related to a problem?

No

Describe the solution you'd like

When exporting data mart data from Pega, we need to use data flows (due to security settings in browsers that block file downloads). This often results in many different zip files. To prep this for PDSTools, we need to merge all the zip (really the json within) to a single file so that ADMDatamart class can operate on it.

In the current file_io there is a readMultiZip function that reads and combines multiple zips. However you need to handle specifying the glob pattern eg:

path = "/Users/hamnb/Downloads/ADM2/"

pattern="Data-Decision-ADM-ModelSnapshot_pzModelSnapshots*"
model_files = glob.glob(os.path.join(path, pattern))

pattern = "Data-Decision-ADM-PredictorBinningSnapshot*"
bin_files = glob.glob(os.path.join(path, pattern))

Once you have these lists of files, you can call the readMultiZip to get the combined file.

Would be nice to have this all available and documented, in both the notebook and quarto examples, where you simply supply the path, and whether it is a mutli-zip file (or multi json).

Describe alternatives you've considered

Wrote the glob pattern in our notebook.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants