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

Data sanity rules #138

Open
richfab opened this issue Oct 19, 2023 · 2 comments
Open

Data sanity rules #138

richfab opened this issue Oct 19, 2023 · 2 comments

Comments

@richfab
Copy link
Contributor

richfab commented Oct 19, 2023

What is the issue and why is it an issue?

Following the discussion in #106, consensus was reached to create a separate issue to discuss whether rules that verify data sanity should be added to the validator (ie: validation rules that are not part of the spec).

Examples of data sanity rules can be:

  • station capacity value should not be lower than num_vehicles_available + num_docks_available
  • reservation_price_flat_rate should be in cents
  • etc

Open questions are:

  • Should the validator remain a canonical validator (only validate rules that are part of the spec) or should it also help producers detect errors in the content of their data?
  • What process or rationale should determine what these rules and their threshold values should be?
  • Who shall bear the burden of maintaining these rules over time?

Please describe some potential solutions you have considered (even if they aren’t related to GBFS).

The code for a dozen data sanity rules can be found in the commits of #106. This code will be removed from that PR to separate data sanity rules (not part of the spec) and data compliance rules (part of the spec).

@tdelmas
Copy link
Collaborator

tdelmas commented Oct 19, 2023

  • the last_updated timestamp should not be in the future

As the specification says about last_updated: "Indicates the last time data in the feed was updated. ", I would argue that alast_updated in the future does break the specification.

A clearer example of "validation rules that are not part of the spec" could be "the unlock price is < 100€": that rule is not part of the specification, but could detect systems where "€ cents" and € were confused.

@richfab
Copy link
Contributor Author

richfab commented Oct 23, 2023

I would argue that a last_updated in the future does break the specification.

You are right @tdelmas. I have updated the issue descriptions to keep this rule in #106. Thank you!

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

No branches or pull requests

2 participants