Skip to content

Conversation

badasahog
Copy link
Contributor

@badasahog badasahog commented Aug 11, 2025

I renamed some of the parser functions to be more consistent with the wider codebase, as well as more descriptive.

These functions aren't called directly, so the diff is relatively small.

Also, making the parser array const may improve performance.

@badasahog badasahog requested a review from aitap as a code owner August 11, 2025 07:16
Copy link

github-actions bot commented Aug 11, 2025

  • HEAD=parserFunctionRename stopped early for fread(colClasses='Date') improved in #6107
  • HEAD=parserFunctionRename stopped early for fread(select=list(Date='date')) improved in #6107
  • HEAD=parserFunctionRename stopped early for fread(colClasses=list(Date='date')) improved in #6107
    Comparison Plot

Generated via commit 3278bd9

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 5 minutes and 1 seconds
Installing different package versions 9 minutes and 58 seconds
Running and plotting the test cases 2 minutes and 37 seconds

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.09%. Comparing base (88635ad) to head (3278bd9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7248   +/-   ##
=======================================
  Coverage   99.09%   99.09%           
=======================================
  Files          83       83           
  Lines       16089    16089           
=======================================
  Hits        15944    15944           
  Misses        145      145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@badasahog
Copy link
Contributor Author

@MichaelChirico I have 5 PRs outstanding, please review.

@badasahog badasahog mentioned this pull request Sep 10, 2025
@@ -635,12 +635,12 @@ static void str_to_i32_core(const char **pch, int32_t *target, bool parse_date)
}
}

static void StrtoI32(FieldParseContext *ctx)
static void parse_i32(FieldParseContext *ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't the consistent naming here be parse_int32_str (parse_${DEST_TYPE}_${SOURCE_DESCRIPTION})?

@@ -1123,7 +1123,7 @@ static void parse_empty(FieldParseContext *ctx)
}

/* Parse numbers 0 | 1 as boolean and ,, as NA (fwrite's default) */
static void parse_bool_numeric(FieldParseContext *ctx)
static void parse_bool_10(FieldParseContext *ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the old name, right now it's only 1/0 but I'm not sure we would add another parser if we wanted to, say, include 00,01. numeric->bool seems the best description here.

@@ -1189,7 +1189,7 @@ static void parse_bool_lowercase(FieldParseContext *ctx)
}

/* Parse Y | y | N | n as boolean */
static void parse_bool_yesno(FieldParseContext *ctx)
static void parse_bool_yn(FieldParseContext *ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, "yes/no" is the most general description for what this parser could do, anchoring on only y/n in a sense exposes the implementation detail that this currently only applies to those two characters -- in principle eventually y e s | n o could be parsed here.

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

Successfully merging this pull request may close these issues.

2 participants