Stefan Adelbert
02/16/2023, 4:27 AM{
repositoriesOrError {
... on RepositoryConnection {
nodes {
jobs {
runs {
id
startTime
endTime
}
}
}
}
}
}
looks like
{
"data": {
"repositoriesOrError": {
"nodes": [
{
"jobs": [
{
"runs": [
{
"id": "25718726-4265-45fb-b92f-ef656ec0703a",
"startTime": 1675048818.020318,
"endTime": 1675048823.704493
}
]
}
]
}
]
}
}
}
The startTime
and endTime
have documentation like
startTime: Float
TYPE DETAILS
TheWhat can we assume about the timezone or locale of those times?scalar type represents signed double-precision fractional values as specified by IEEE 754.Float
owen
02/16/2023, 5:49 PMStefan Adelbert
02/16/2023, 10:51 PMStefan Adelbert
02/17/2023, 5:02 AMAustralia/Sydney
) is Fri 17 Feb 2023 15:38:56 AEDT
. I'm running the dagster stack in docker compose.
When I query the runs using GraphQL with
{
repositoriesOrError {
... on RepositoryConnection {
nodes {
jobs {
runs {
id
startTime
endTime
}
}
}
}
}
}
I get
...
{
"jobs": [
{
"runs": [
{
"id": "bdf713fc-adbd-4514-b4fa-1b35f7a55531",
"startTime": 1676608531.281406,
"endTime": 1676608531.53234
}
]
},
{
"runs": []
},
{
"runs": []
}
]
},
...
Converting startTime
into a datetime, I get a naive datetime (of course), but apparently at my current location.
>>> import datetime
>>> datetime.datetime.fromtimestamp(1676608531.281406)
datetime.datetime(2023, 2, 17, 15, 35, 31, 281406)
>>> datetime.datetime.utcnow()
datetime.datetime(2023, 2, 17, 4, 43, 26, 707856)
>>> datetime.datetime.now()
datetime.datetime(2023, 2, 17, 15, 43, 30, 499757)
I suspect that it has to do with the locale where dagit
is running, i.e. the start time is being localised and the converted to a timestamp, kinda like the difference between these
>>> datetime.datetime.timestamp(datetime.datetime.utcnow())
1676569595.505416
>>> datetime.datetime.timestamp(datetime.datetime.now())
1676609192.641514
I've had a quick look at the dagster source code and I can see calls like pendulum.now("UTC")
peppered around. And generally there aren't calls to plain old now()
other than in tests.owen
02/17/2023, 6:46 PMStefan Adelbert
02/19/2023, 11:43 PMpendulum
for good.
Thank you @owen and my apologies for using up some of your time.