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

Optimize CSV validation and header mapping logic if header is enabled #115

Merged
merged 4 commits into from Mar 30, 2024

Conversation

SmetDenis
Copy link
Member

This commit addresses several changes in the CSV validation and header mapping logic. Firstly, a method to set IDs has been added in Column.php. Also, handling of headers in CSV files has been updated to better support files with and without headers. In addition, mapping of columns by header names has been moved to CsvFile.php from Schema.php for better alignment with data flow. Lastly, unnecessary exception throwing in getColumn method of Schema.php has been removed. Unit tests have also been updated to reflect these changes.

This commit addresses several changes in the CSV validation and header mapping logic. Firstly, a method to set IDs has been added in Column.php. Also, handling of headers in CSV files has been updated to better support files with and without headers. In addition, mapping of columns by header names has been moved to CsvFile.php from Schema.php for better alignment with data flow. Lastly, unnecessary exception throwing in getColumn method of Schema.php has been removed. Unit tests have also been updated to reflect these changes.
This commit includes implementing integer conversion for index mapping in CsvFile.php, which improves the header mapping logic. Furthermore, the header specification 'csv: header: false' has been removed from various test yaml files, implying a shift towards handling CSV files with headers. The changes collectively lead to a considerably streamlined CSV data processing workflow.
@coveralls
Copy link

coveralls commented Mar 30, 2024

Pull Request Test Coverage Report for Build 8493418198

Details

  • 32 of 35 (91.43%) changed or added relevant lines in 5 files are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.4%) to 96.625%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Validators/ValidatorCsv.php 14 15 93.33%
src/Utils.php 1 3 33.33%
Files with Coverage Reduction New Missed Lines %
src/Validators/ValidatorCsv.php 7 88.72%
Totals Coverage Status
Change from base Build 8492595486: -0.4%
Covered Lines: 2491
Relevant Lines: 2578

💛 - Coveralls

This commit revamps the Makefile's BENCH_SCHEMAS variable to provide dynamic benchmarks selection. It also adjusts the benchmark-running targets to accommodate this change. These changes allow running different sets of benchmarks, improving overall benchmarking efficiency and customizability.
This change introduces a new attribute, 'name', in column rules within various Benchmark files. It improves clarity and identification of rule sets by assigning each with a distinct 'name'. This adjustment enhances the overall testing practice and results in better data organization and manipulation.
@SmetDenis SmetDenis merged commit 9e9f13d into master Mar 30, 2024
25 checks passed
@SmetDenis SmetDenis deleted the optimize-headers branch March 30, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants