Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C csvkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wireservice
  • csvkit
  • Merge requests
  • !1095

Fixed csvformat's -H/--no-header-row functionality

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/dannguyen/csvformat-no-header-row-fix into master Oct 22, 2020
  • Overview 3
  • Commits 5
  • Pipelines 0
  • Changes 2

Created by: dannguyen

(I submitted this pull request previously, but had a personal accident with git push --force that resulted in wiping out that request)

As of 1.0.6 official, csvformat --no-header-row had no effect, e.g.

$ csvformat -H examples/dummy.csv
a,b,c
1,2,3

The expected result is:

$ csvformat -H examples/dummy.csv
a,b,c
a,b,c
1,2,3

I made a small fix to the if self.args.no_header_row: conditional branch in csvformat.py: https://github.com/dannguyen/csvkit/commit/c4afb6cfb722eac0d7f6d806dc8af85a48251204#diff-2cc13332fa912f35edb0048f998a890bebba81bcbfdb11a020e82f76555098a7R53

The corresponding test in test_csvformat.py did not have the correct expected results, so I made the necessary quick fix there too:

https://github.com/dannguyen/csvkit/commit/c4afb6cfb722eac0d7f6d806dc8af85a48251204#diff-33185ce77554d4e053def57300073762fa8909916f3652dd8739a1ecb69676f0R32

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/dannguyen/csvformat-no-header-row-fix