Changes in code to aggregate single files together#2
Open
dyutivartak wants to merge 1 commit intomainfrom
Open
Changes in code to aggregate single files together#2dyutivartak wants to merge 1 commit intomainfrom
dyutivartak wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updated
02-aggregate_data.pyto correctly aggregate CSV files from the nestedoutput/directory structure. The script now recursively searches through all date-stamped subdirectories (us-census-data-YYYYMMDD/imports/andus-census-data-YYYYMMDD/exports/) and combines all CSV files into two consolidated datasets.Key Changes:
glob.glob()with recursive pattern matchingRaw_Data/imports_all_files/andRaw_Data/exports_all_files/tooutput/*/importsandoutput/*/exportsoutput/imports_combined.csvandoutput/exports_combined.csvrequest_log.csvfiles from aggregationMotivation and Context (link issue)
The previous implementation expected CSV files in flat directories (
Raw_Data/imports_all_files/andRaw_Data/exports_all_files/), but the actual data structure from01-request_data.pystores files in a nested hierarchy:output/
└── us-census-data-YYYYMMDD/
├── imports/
│ └── YYYY/
│ └── .csv
└── exports/
└── YYYY/
└── .csv
This change ensures the aggregation script correctly processes all data files regardless of their location in the nested directory structure.
How Has This Been Tested?
Test Results:
output/imports_combined.csv(1,470,643 records, 230MB)output/exports_combined.csv(1,376,889 records, 212MB)request_log.csvfiles are correctly excludedScreenshots (if appropriate):
Types of changes
Checklist: