Skip to content

Conversation

@qcdyx
Copy link
Contributor

@qcdyx qcdyx commented Mar 3, 2025

Summary:
Closes #1980

Expected behavior:
image

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@qcdyx qcdyx linked an issue Mar 3, 2025 that may be closed by this pull request
@emmambd emmambd requested a review from skalexch March 3, 2025 16:39
@qcdyx qcdyx marked this pull request as draft March 3, 2025 16:40
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 0317690
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (1 out of 1824 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-california-bay-area-rapid-transit-bart-gtfs-53 missing_required_column
New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.72 3.82 ⬆️+0.09
Median -- 1.36 1.44 ⬆️+0.08
Standard Deviation -- 10.85 10.95 ⬆️+0.09
Minimum in References Reports us-oregon-high-desert-point-gtfs-636 0.48 0.50 ⬆️+0.02
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 281.55 283.10 ⬆️+1.54
Minimum in Latest Reports ar-buenos-aires-subterraneos-de-buenos-aires-subte-gtfs-6 0.58 0.49 ⬇️-0.08
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 281.55 283.10 ⬆️+1.54
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 475.38 MiB 466.48 MiB ⬇️-8.90 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 820.13 MiB 768.17 MiB ⬇️-51.96 MiB
Minimum in References Reports us-iowa-iowa-city-transit-system-gtfs-559 40.26 MiB 41.99 MiB ⬆️+1.73 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.67 GiB 10.79 GiB ⬆️+125.83 MiB
Minimum in Latest Reports us-colorado-town-of-telluride-gtfs-2050 40.67 MiB 38.82 MiB ⬇️-1.85 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.67 GiB 10.79 GiB ⬆️+125.83 MiB

@qcdyx qcdyx marked this pull request as ready for review March 3, 2025 18:47
@qcdyx qcdyx requested a review from emmambd March 3, 2025 18:48
@emmambd
Copy link
Contributor

emmambd commented Mar 3, 2025

Looks like the missing_required_column issue is still happening with acceptance tests. cc @davidgamez

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 67a8ef2
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.73 3.84 ⬆️+0.10
Median -- 1.35 1.41 ⬆️+0.06
Standard Deviation -- 11.08 11.21 ⬆️+0.13
Minimum in References Reports us-oregon-high-desert-point-gtfs-636 0.47 0.51 ⬆️+0.04
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 300.83 301.74 ⬆️+0.91
Minimum in Latest Reports us-florida-citrus-county-transit-gtfs-630 0.47 0.46 ⬇️-0.01
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 300.83 301.74 ⬆️+0.91
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 464.60 MiB 464.94 MiB ⬆️+347.79 KiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 773.33 MiB 762.28 MiB ⬇️-11.05 MiB
Minimum in References Reports us-south-dakota-sioux-area-metro-sam-gtfs-192 38.51 MiB 53.40 MiB ⬆️+14.89 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.72 GiB 11.06 GiB ⬆️+340.16 MiB
Minimum in Latest Reports ro-vrancea-consiliul-judetean-vrancea-gtfs-1984 69.02 MiB 37.99 MiB ⬇️-31.04 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.72 GiB 11.06 GiB ⬆️+340.16 MiB

@skalexch
Copy link
Contributor

skalexch commented Mar 3, 2025

@qcdyx I'm not sure about the tests, the test is passing but I feel like it's not validating the proposed behavior.
The fare_product_id should be the same "fare 1" and applied to two default rider_categories "rider 1" and "rider 2"

I also added a comment about the creation of test rider_categories. With that one, the rider_category_id is unique. So one category cannot be default and not default at the same time

@qcdyx
Copy link
Contributor Author

qcdyx commented Mar 3, 2025

@emmambd @davidgamez Could you clarify the next steps for this rule?

I also added a comment about the creation of test rider_categories. With that one, the rider_category_id is unique. So one category cannot be default and not default at the same time

@emmambd
Copy link
Contributor

emmambd commented Mar 3, 2025

@qcdyx I think @skalexch's comment is specifically about your test file, not about the rule logic itself. @skalexch is that an accurate interpretation? Let's move this to Slack if it needs back and forth, but the logic of the rule goes unchanged I believe.

@qcdyx
Copy link
Contributor Author

qcdyx commented Mar 3, 2025

Thanks @emmambd for clarification. @skalexch I temporarily modified the test dataset to generate a screenshot for Emma to verify the notice name and description. I should've let you know beforehand.

@skalexch
Copy link
Contributor

skalexch commented Mar 3, 2025

@qcdyx what I meant was the tests are probably not testing what the notice should flag. The notice code looks right (my java isn't great but it seems like you're createing a map of productId -> riderCategoryId if it is default then counting the occurences).
So the test needs to be adjusted to reflect what the notice is supposed to validate.

@qcdyx qcdyx marked this pull request as draft March 3, 2025 21:04
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/main/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidator.java
  • src/test/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidatorTest.java

Go to the Actions Dashboard to download the full Spotless output

@qcdyx qcdyx marked this pull request as ready for review March 4, 2025 16:04
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/main/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidator.java
  • src/test/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidatorTest.java

Go to the Actions Dashboard to download the full Spotless output

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/main/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidator.java
  • src/test/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidatorTest.java

Go to the Actions Dashboard to download the full Spotless output

qcdyx added 3 commits March 4, 2025 11:06
…ories' of github.com:MobilityData/gtfs-validator into 1980-add-fare_product_with_multiple_default_rider_categories
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • at org.gradle.wrapper.Download.downloadInternal(Download.java:122)
  • at org.gradle.wrapper.Download.download(Download.java:80)
  • at org.gradle.wrapper.Install$1.call(Install.java:82)
  • at org.gradle.wrapper.Install$1.call(Install.java:62)
  • at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
  • at org.gradle.wrapper.Install.createDist(Install.java:62)
  • at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
  • at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
  • at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:557)
  • at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:608)
  • at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
  • at java.base/java.net.Socket.connect(Socket.java:641)
  • at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
  • at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
  • at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
  • at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
  • at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
  • at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
  • at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1260)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1146)
  • at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2972)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2881)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1977)
  • at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1629)
  • at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
  • at org.gradle.wrapper.Download.downloadInternal(Download.java:100)

Go to the Actions Dashboard to download the full Spotless output

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit f36d6b2
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (3 out of 1824 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-california-culver-city-bus-gtfs-38 fare_product_with_multiple_default_rider_categories
us-oregon-trimet-portland-streetcar-gtfs-247 fare_product_with_multiple_default_rider_categories
us-washington-c-tran-gtfs-258 fare_product_with_multiple_default_rider_categories
Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.71 3.78 ⬆️+0.08
Median -- 1.35 1.40 ⬆️+0.05
Standard Deviation -- 10.80 10.84 ⬆️+0.04
Minimum in References Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 0.47 0.55 ⬆️+0.08
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 281.05 277.95 ⬇️-3.10
Minimum in Latest Reports us-oregon-high-desert-point-gtfs-636 0.49 0.49 ⬇️-0.00
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 281.05 277.95 ⬇️-3.10
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 471.27 MiB 466.00 MiB ⬇️-5.26 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 800.11 MiB 769.74 MiB ⬇️-30.37 MiB
Minimum in References Reports us-california-westcat-gtfs-78 39.70 MiB 39.70 MiB ⬇️-3.90 KiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.77 GiB 10.83 GiB ⬆️+61.86 MiB
Minimum in Latest Reports us-california-redding-area-bus-authority-raba-gtfs-114 48.36 MiB 38.61 MiB ⬇️-9.75 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.77 GiB 10.83 GiB ⬆️+61.86 MiB

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM

@emmambd
Copy link
Contributor

emmambd commented Mar 4, 2025

Waiting on @skalexch for this

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 67855c4
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (3 out of 1824 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-california-culver-city-bus-gtfs-38 fare_product_with_multiple_default_rider_categories
us-oregon-trimet-portland-streetcar-gtfs-247 fare_product_with_multiple_default_rider_categories
us-washington-c-tran-gtfs-258 fare_product_with_multiple_default_rider_categories
Dropped Errors (1 out of 1824 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-california-get-around-town-express-gtfs-606 missing_required_column
New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.69 3.73 ⬆️+0.03
Median -- 1.33 1.36 ⬆️+0.02
Standard Deviation -- 10.82 10.76 ⬇️-0.06
Minimum in References Reports ph-unknown-hm-transport-inc-and-robinsons-malls-gtfs-1105 0.47 0.52 ⬆️+0.05
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 284.61 278.67 ⬇️-5.93
Minimum in Latest Reports us-california-city-of-wasco-gtfs-1788 0.51 0.45 ⬇️-0.06
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 284.61 278.67 ⬇️-5.93
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 469.91 MiB 461.94 MiB ⬇️-7.98 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 794.39 MiB 750.57 MiB ⬇️-43.81 MiB
Minimum in References Reports us-california-laguna-beach-transit-lbt-gtfs-16 39.67 MiB 407.92 MiB ⬆️+368.25 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.91 GiB 11.00 GiB ⬆️+95.02 MiB
Minimum in Latest Reports us-california-yubasutter-transit-gtfs-79 49.31 MiB 39.54 MiB ⬇️-9.77 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.91 GiB 11.00 GiB ⬆️+95.02 MiB

@skalexch
Copy link
Contributor

skalexch commented Mar 4, 2025

@qcdyx thanks for updating. There's one detail left to clear out the false positives.
For the flagged feeds, the same fare_product_id was associated with the same rider_category_id but had different fare_media_id since it's part of the primary key. What the code does is that when it detects that a rider_category_id is default, it adds it to the count of the fare_product_id. So it seems like it's double counting the same ADULT category.
I think a better approach would be having the hashmap value be a set then count the elements in that set. Or just do a check that the category already exists in the value of a hashmap. Then count the elements in the fareProductDefaultCount.get(fareProductId)
Screenshot 2025-03-04 at 4 33 58 PM

qcdyx added 3 commits March 4, 2025 16:46
…ories' of github.com:MobilityData/gtfs-validator into 1980-add-fare_product_with_multiple_default_rider_categories
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit d89e2a6
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.73 3.87 ⬆️+0.14
Median -- 1.37 1.43 ⬆️+0.06
Standard Deviation -- 10.91 10.91 ⬇️-0.01
Minimum in References Reports us-california-flex-v2-developer-test-feed-1-gtfs-1817 0.48 0.49 ⬆️+0.01
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 287.15 280.12 ⬇️-7.03
Minimum in Latest Reports us-california-flex-v2-developer-test-feed-3-gtfs-1819 0.49 0.48 ⬇️-0.01
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 287.15 280.12 ⬇️-7.03
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 467.13 MiB 469.23 MiB ⬆️+2.10 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 766.29 MiB 782.20 MiB ⬆️+15.91 MiB
Minimum in References Reports us-iowa-sioux-city-transit-system-gtfs-191 38.98 MiB 399.92 MiB ⬆️+360.94 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.63 GiB 11.07 GiB ⬆️+452.71 MiB
Minimum in Latest Reports us-alaska-capital-transit-gtfs-294 399.92 MiB 38.63 MiB ⬇️-361.29 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.63 GiB 11.07 GiB ⬆️+452.71 MiB

@davidgamez
Copy link
Member

@qcdyx thanks for updating. There's one detail left to clear out the false positives. For the flagged feeds, the same fare_product_id was associated with the same rider_category_id but had different fare_media_id since it's part of the primary key. What the code does is that when it detects that a rider_category_id is default, it adds it to the count of the fare_product_id. So it seems like it's double counting the same ADULT category. I think a better approach would be having the hashmap value be a set then count the elements in that set. Or just do a check that the category already exists in the value of a hashmap. Then count the elements in the fareProductDefaultCount.get(fareProductId) Screenshot 2025-03-04 at 4 33 58 PM

Hi @skalexch, does this require clarification on the spec?

@skalexch
Copy link
Contributor

skalexch commented Mar 5, 2025

@davidgamez maybe we can change the description to "When multiple unique rider categories are eligible for a single fare product specified by a fare_product_id, there must be exactly one of these eligible rider categories indicated as the default rider category (is_default_fare_category = 1)."
@tzujenchanmbd will probably have a better phrasing for it. We'll discuss it when he gets back

@emmambd
Copy link
Contributor

emmambd commented Mar 5, 2025

@skalexch You mean on the spec side? Sounds good. The validator side will be merged this week and we can make changes later post 7.0

@skalexch
Copy link
Contributor

skalexch commented Mar 5, 2025

@emmambd yes on the spec side. On the validator side once Jingsi resolves the final comment I'll do one final round of QA and I think it will be ready to go.

@davidgamez
Copy link
Member

davidgamez commented Mar 5, 2025

@davidgamez maybe we can change the description to "When multiple unique rider categories are eligible for a single fare product specified by a fare_product_id, there must be exactly one of these eligible rider categories indicated as the default rider category (is_default_fare_category = 1)." @tzujenchanmbd will probably have a better phrasing for it. We'll discuss it when he gets back

My only concern is that is not clear that fare_media_id is part of the logic. For me, both interpretations are correct =>

  • Can be only one rider category default per fare_product_id
  • Can be only one rider category default per fare_product_id+fare_media_id

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 08259ca
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.76 3.88 ⬆️+0.13
Median -- 1.38 1.44 ⬆️+0.07
Standard Deviation -- 11.09 11.09 ⬆️+0.00
Minimum in References Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 0.48 0.52 ⬆️+0.04
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 290.33 287.35 ⬇️-2.98
Minimum in Latest Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 0.48 0.52 ⬆️+0.04
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 290.33 287.35 ⬇️-2.98
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 464.22 MiB 478.14 MiB ⬆️+13.92 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 760.35 MiB 822.68 MiB ⬆️+62.32 MiB
Minimum in References Reports us-california-redding-area-bus-authority-raba-gtfs-114 38.51 MiB 55.21 MiB ⬆️+16.70 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.81 GiB 11.00 GiB ⬆️+194.47 MiB
Minimum in Latest Reports us-massachusetts-marthas-vineyard-transit-authority-gtfs-420 407.92 MiB 39.45 MiB ⬇️-368.48 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.81 GiB 11.00 GiB ⬆️+194.47 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

🚨 Code Formatting Issue 🚨

This contribution does not follow the conventions set by the Google Java Style Guide.

Please run the following command at the root of the project to fix formatting errors:

./gradlew spotlessApply
🗂️ Affected files
  • src/test/java/org/mobilitydata/gtfsvalidator/validator/FareProductDefaultRiderCategoriesValidatorTest.java

Go to the Actions Dashboard to download the full Spotless output

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 34c9601
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (3 out of 1824 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-california-culver-city-bus-gtfs-38 fare_product_with_multiple_default_rider_categories
us-oregon-trimet-portland-streetcar-gtfs-247 fare_product_with_multiple_default_rider_categories
us-washington-c-tran-gtfs-258 fare_product_with_multiple_default_rider_categories
Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.76 3.84 ⬆️+0.09
Median -- 1.37 1.45 ⬆️+0.08
Standard Deviation -- 10.95 11.01 ⬆️+0.07
Minimum in References Reports es-santa-cruz-de-tenerife-metropolitano-de-tenerife-gtfs-788 0.46 0.51 ⬆️+0.04
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 285.99 285.66 ⬇️-0.34
Minimum in Latest Reports us-california-flex-v2-developer-test-feed-1-gtfs-1817 0.61 0.49 ⬇️-0.11
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 285.99 285.66 ⬇️-0.34
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 468.99 MiB 463.98 MiB ⬇️-5.01 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 782.30 MiB 750.83 MiB ⬇️-31.47 MiB
Minimum in References Reports ro-vrancea-consiliul-judetean-vrancea-gtfs-1984 37.96 MiB 69.77 MiB ⬆️+31.80 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 11.08 GiB 11.03 GiB ⬇️-57.89 MiB
Minimum in Latest Reports us-ohio-allen-county-regional-transit-authority-gtfs-210 415.92 MiB 39.23 MiB ⬇️-376.69 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 11.08 GiB 11.03 GiB ⬇️-57.89 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit fe10753
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.72 3.82 ⬆️+0.10
Median -- 1.35 1.43 ⬆️+0.08
Standard Deviation -- 10.90 11.01 ⬆️+0.10
Minimum in References Reports us-florida-citrus-county-transit-gtfs-630 0.47 0.51 ⬆️+0.05
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 285.00 290.12 ⬆️+5.12
Minimum in Latest Reports es-santa-cruz-de-tenerife-metropolitano-de-tenerife-gtfs-788 0.59 0.48 ⬇️-0.11
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 285.00 290.12 ⬆️+5.12
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 463.23 MiB 469.69 MiB ⬆️+6.47 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 761.75 MiB 771.29 MiB ⬆️+9.54 MiB
Minimum in References Reports us-maryland-shore-transit-gtfs-494 37.96 MiB 403.92 MiB ⬆️+365.96 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.81 GiB 10.73 GiB ⬇️-81.84 MiB
Minimum in Latest Reports us-colorado-boulder-county-gtfs-2191 415.92 MiB 39.13 MiB ⬇️-376.79 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.81 GiB 10.73 GiB ⬇️-81.84 MiB

Copy link
Contributor

@skalexch skalexch left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the work!

static List<GtfsFareProduct> createFareProductTable() {
List<GtfsFareProduct> fareProducts = new ArrayList<>();
fareProducts.add(createFareProduct(1, "fare1", "rider1"));
fareProducts.add(createFareProduct(2, "fare2", "rider2"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if the test validates a correct behavior
For fare products, the fare_product_id should be the same

fareProducts.add(createFareProduct(1, "fare1", "rider1"));
fareProducts.add(createFareProduct(1, "fare1", "rider2"));

static List<GtfsRiderCategories> createRiderCategoriesTable() {
List<GtfsRiderCategories> riderCategories = new ArrayList<>();
riderCategories.add(createRiderCategories(1, "rider1", GtfsRiderFareCategory.IS_DEFAULT));
riderCategories.add(createRiderCategories(2, "rider1", GtfsRiderFareCategory.NOT_DEFAULT));
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for spec correctness and to work with the suggested change above, we cannot have the same rider_category_id associated with Default and Not default.
I think a more compliant approach is

    riderCategories.add(createRiderCategories(1, "rider1", GtfsRiderFareCategory.IS_DEFAULT));
    riderCategories.add(createRiderCategories(2, "rider2", GtfsRiderFareCategory.IS_DEFAULT));
    riderCategories.add(createRiderCategories(3, "rider3", GtfsRiderFareCategory.IS_NOT_DEFAULT));

@qcdyx qcdyx merged commit 2efab9c into master Mar 5, 2025
132 checks passed
@qcdyx qcdyx deleted the 1980-add-fare_product_with_multiple_default_rider_categories branch March 5, 2025 18:53
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 6b225a7
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1824 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1824 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.75 3.84 ⬆️+0.09
Median -- 1.37 1.42 ⬆️+0.06
Standard Deviation -- 11.07 11.08 ⬆️+0.01
Minimum in References Reports us-california-city-of-wasco-gtfs-1788 0.49 0.56 ⬆️+0.07
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 288.33 286.55 ⬇️-1.79
Minimum in Latest Reports us-michigan-detroit-people-mover-gtfs-417 0.54 0.49 ⬇️-0.05
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 288.33 286.55 ⬇️-1.79
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 462.56 MiB 470.31 MiB ⬆️+7.75 MiB
Median -- 335.92 MiB 335.92 MiB ⬇️0 bytes
Standard Deviation -- 753.71 MiB 795.42 MiB ⬆️+41.71 MiB
Minimum in References Reports us-california-redding-area-bus-authority-raba-gtfs-114 38.54 MiB 43.10 MiB ⬆️+4.56 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.66 GiB 10.94 GiB ⬆️+287.33 MiB
Minimum in Latest Reports us-massachusetts-marthas-vineyard-transit-authority-gtfs-420 415.92 MiB 39.41 MiB ⬇️-376.51 MiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.66 GiB 10.94 GiB ⬆️+287.33 MiB

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.

Add fare_product_with_multiple_default_rider_categories

5 participants