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

Discard date RDD filter only takes a single string, not a list of strings. #532

Closed
ruebot opened this issue May 18, 2022 · 0 comments
Closed
Assignees
Labels

Comments

@ruebot
Copy link
Member

ruebot commented May 18, 2022

Keep dates, and discard dates are not consistent.

keepDate takes a list of strings, with date component.

    /** Removes all data that does not have selected date.
      *
      * @param dates a list of dates
      * @param component the selected DateComponent enum value
      */
    def keepDate(
        dates: List[String],
        component: DateComponent = DateComponent.YYYYMMDD
    ): RDD[ArchiveRecord] = {
      rdd.filter(r => dates.contains(ExtractDate(r.getCrawlDate, component)))
    }

discardDate only takes a single date as a string.

    /** Filters detected dates.
      *
      * @param date a list of dates
      */
    def discardDate(date: String): RDD[ArchiveRecord] = {
      rdd.filter(r => r.getCrawlDate != date)
    }
@ruebot ruebot added the bug label May 18, 2022
@ruebot ruebot self-assigned this May 18, 2022
ruebot added a commit that referenced this issue May 18, 2022
* fix discardDate issue
* update tests for #494
* add test for #493
* add test for #532
* move issue specific tests to their own directory
* add copyright statement to SparklingArchiveRecord
* move webarchive-commons back to 1.1.9
* resolves #532
* resolves #494
* resolves #493
* resolves #492
* resolves #317
* resolves #260
* resolves #182
* resolves #76
* resolves #74
* resolves #73
* resolves #23
* resolves #18
@ruebot ruebot closed this as completed in c8fa256 May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant