Update timestamp desc to unix timestamp milliseconds#138
Update timestamp desc to unix timestamp milliseconds#138asadowns wants to merge 9 commits intoopenmobilityfoundation:devfrom
Conversation
Per openmobilityfoundation#104 and openmobilityfoundation#133 all timestamp references are unix timestamp in milliseconds. Provide link with different language implementations. Also, update all provider sample data to be in unix timestamps in milliseconds. No changes made to agency. Addresses: openmobilityfoundation#104 and openmobilityfoundation#133
thekaveman
left a comment
There was a problem hiding this comment.
Great clarifications, thank you @asadowns!
I'm pinning this to 0.2.1, a downcast from float -> int doesn't seem like a breaking change to me. @hunterowens @ian-r-rose ?
|
in postgres runs successfully and if you pass So at least in the python/postgres DB world this in non-breaking. I don't think that will be universal but right now that is most provider ingest stacks so I am okay making the change. We should also update the JSONSchema, right @ian-r-rose? |
|
Yes, I think it should be updated. I think that, strictly speaking, changing the type from a float to an integer would be considered a breaking change. Python is pretty lax in this regard, and Javascript doesn't even have the concept of integers, but if anybody is developing tooling in JVM-based or C-allied languages there could be some updates required. As long as we are discussing changing data types, is there a reason the |
|
@ian-r-rose can you move that discussion to #128. I'm tracking all JSON schema errors over there. |
|
So we're saying this is breaking then, and should be in |
…ta-standard into dev * 'dev' of https://github.com/CityOfLosAngeles/mobility-data-standard: Fixing newlines again (openmobilityfoundation#135) typo fix. Update README to show associated python libraries (openmobilityfoundation#132) Add Lyft Add Razor to providers.csv update update_vehicle_status to use standard post clarification on how we extend GBFS Elevating Status of Realtime Feed
|
I've been wrestling with this issue for a few days, and learning a whole bunch about how weird python and the concept of time can get. That being said, this seems like an important change, and I'm unaware of anybody building MDS ingest tooling in a language that doesn't silently downcast floats->ints, so I think we should tag this in 0.2.1. I'll update the milestone and the JSON schema to get this PR ready to merge. |
…://github.com/asadowns/mobility-data-specification into asadowns-adowns/133-104-provider-timestamp-unix-millis * 'adowns/133-104-provider-timestamp-unix-millis' of https://github.com/asadowns/mobility-data-specification: Update timestamp desc to unix timestamp milliseconds
|
@asadowns can you give me permission to push to this branch? there are some changes to the JSON schema needed to support this PR. Follow these steps |
|
@hunterowens . Looks like it is already clicked but you should be good to go now. |
|
found the issue, was trying to push the @adownsbird to the @asadowns branch. fixed now. |
generate_schema/common.json
Outdated
| "timestamp": { | ||
| "$id": "#/definitions/timestamp", | ||
| "title": "Floating-point seconds since Unix epoch", | ||
| "title": "Integer seconds since Unix epoch", |
There was a problem hiding this comment.
seconds -> milliseconds
generate_schema/common.json
Outdated
| "title": "Integer seconds since Unix epoch", | ||
| "type": "number", | ||
| "minimum": 0.0 | ||
| "multiple_of": 1.0, |
There was a problem hiding this comment.
I think the keyword is multipleOf - but I like this, nice approach!
| ] | ||
| }, | ||
| "properties": { | ||
| "type": "object", |
There was a problem hiding this comment.
type can be an array, see #142 for how I implemented this to allow null for the optional fields like parking_verification_url.
provider/status_changes.json
Outdated
| "title": "Integer seconds since Unix epoch", | ||
| "type": "number", | ||
| "minimum": 0.0 | ||
| "multiple_of": 1.0, |
generate_schema/common.json
Outdated
| "type": "number", | ||
| "minimum": 0.0 | ||
| "multiple_of": 1.0, | ||
| "minimum": 1483228800 |
There was a problem hiding this comment.
Is this a good idea to enforce via the schema?
What about a process that generates fake data, shouldn't it be allowed to generate data across whatever time series it wants?
If MDS gets back-ported to TNCs and other related types of shared mobility, this could hamstring the ability to get historic data.
There was a problem hiding this comment.
that fair, I'm gonna say let's not enforce via schema but some sort of "truth-yness" validator.
provider/status_changes.json
Outdated
| "type": "number", | ||
| "minimum": 0.0 | ||
| "multiple_of": 1.0, | ||
| "minimum": 1483228800 |
| ] | ||
| }, | ||
| "properties": { | ||
| "type": "object", |
There was a problem hiding this comment.
Use array for type, see comment above
Per openmobilityfoundation#104 and openmobilityfoundation#133 all timestamp references are unix timestamp in milliseconds. Provide link with different language implementations. Also, update all provider sample data to be in unix timestamps in milliseconds. No changes made to agency. Addresses: openmobilityfoundation#104 and openmobilityfoundation#133
|
@thekaveman changes made. |
|
Closing in favor of #146 |

Per #104 and #133 all timestamp references are unix timestamp in milliseconds.
Provide link with different language implementations.
Also, update all provider sample data to be in unix timestamps in milliseconds.
No changes made to agency.
Addresses: #104 and #133