-
Notifications
You must be signed in to change notification settings - Fork 10
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
Let pyarrow cast strings to dates #80
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
[ | ||
{ | ||
"type": "Feature", | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
"https://stac-extensions.github.io/view/v1.0.0/schema.json", | ||
"https://stac-extensions.github.io/sar/v1.0.0/schema.json" | ||
], | ||
"id": "52f2317f-091b-4f90-b385-08c93655e089", | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
-79.54925151958344, | ||
8.974791994120121, | ||
14.312313693418984 | ||
], | ||
[ | ||
-79.58251694872273, | ||
9.005616405406611, | ||
14.318863303708582 | ||
], | ||
[ | ||
-79.61351789024071, | ||
8.972540909838038, | ||
14.312558707495423 | ||
], | ||
[ | ||
-79.58025285722145, | ||
8.941719234834665, | ||
14.318864497230194 | ||
], | ||
[ | ||
-79.54925151958344, | ||
8.974791994120121, | ||
14.312313693418984 | ||
] | ||
] | ||
] | ||
}, | ||
"bbox": [ | ||
-79.61351789024071, | ||
8.941719234834665, | ||
-79.54925151958344, | ||
9.005616405406611 | ||
], | ||
"properties": { | ||
"created": "2024-09-10T10:00:00.425293+00:00", | ||
"updated": "2024-09-10T10:00:00.425300+00:00", | ||
Comment on lines
+49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only this first item has these properties set |
||
"platform": "Umbra-08", | ||
"end_datetime": "2024-09-10T03:32:32.903484+00:00", | ||
"umbra:task_id": "ba1ca3b0-f458-4cd9-8e99-52d2d899d5dd", | ||
"start_datetime": "2024-09-10T03:32:23+00:00", | ||
"sar:product_type": "GEC", | ||
"sar:looks_azimuth": 2, | ||
"sar:polarizations": [ | ||
"VV" | ||
], | ||
"umbra:collect_ids": [ | ||
"7cfa17f0-9b69-4686-949e-5604d24beb3c" | ||
], | ||
"sar:frequency_band": "X", | ||
"sar:instrument_mode": "SPOTLIGHT", | ||
"sar:resolution_range": 0.5, | ||
"view:incidence_angle": 23.750572204589844, | ||
"sar:resolution_azimuth": 0.25, | ||
"umbra:open-data-catalog": true, | ||
"umbra:squint_angle_degrees": 120.06241607666016, | ||
"umbra:grazing_angle_degrees": 66.24942779541016, | ||
"umbra:slant_range_kilometers": 567.7435913085938, | ||
"umbra:target_azimuth_angle_degrees": 138.5594940185547, | ||
"umbra:squint_angle_engineering_degrees": -30.062416076660156, | ||
"umbra:squint_angle_exploitation_degrees": 59.937583923339844, | ||
"umbra:squint_angle_degrees_off_broadside": 59.937583923339844, | ||
"datetime": null | ||
}, | ||
"links": [ | ||
{ | ||
"rel": "collection", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar", | ||
"type": "application/json" | ||
}, | ||
{ | ||
"rel": "parent", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar", | ||
"type": "application/json" | ||
}, | ||
{ | ||
"rel": "root", | ||
"href": "https://api.canopy.umbra.space/archive/", | ||
"type": "application/json", | ||
"title": "stac-fastapi" | ||
}, | ||
{ | ||
"rel": "self", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar/items/52f2317f-091b-4f90-b385-08c93655e089", | ||
"type": "application/geo+json" | ||
} | ||
], | ||
"assets": { | ||
"thumbnail": { | ||
"href": "https://api.canopy.umbra.space/archive/thumbnail/52f2317f-091b-4f90-b385-08c93655e089", | ||
"type": "image/png", | ||
"title": "Thumbnail for 52f2317f-091b-4f90-b385-08c93655e089", | ||
"description": "Low-resolution preview PNG thumbnail for 52f2317f-091b-4f90-b385-08c93655e089", | ||
"roles": [ | ||
"thumbnail" | ||
] | ||
} | ||
}, | ||
"collection": "umbra-sar" | ||
}, | ||
{ | ||
"type": "Feature", | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
"https://stac-extensions.github.io/view/v1.0.0/schema.json", | ||
"https://stac-extensions.github.io/sar/v1.0.0/schema.json" | ||
], | ||
"id": "192f767c-20f8-4b42-8ea2-d1f60fdaace1", | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
-79.55942755490392, | ||
8.960346708857864, | ||
0 | ||
], | ||
[ | ||
-79.56798414722924, | ||
8.995497807881366, | ||
0 | ||
], | ||
[ | ||
-79.60333954966426, | ||
8.986988377465938, | ||
0 | ||
], | ||
[ | ||
-79.59477975406185, | ||
8.951838081249301, | ||
0 | ||
], | ||
[ | ||
-79.55942755490392, | ||
8.960346708857864, | ||
0 | ||
] | ||
] | ||
] | ||
}, | ||
"bbox": [ | ||
-79.60333954966426, | ||
8.951838081249301, | ||
-79.55942755490392, | ||
8.995497807881366 | ||
], | ||
"properties": { | ||
"platform": "Umbra-05", | ||
"end_datetime": "2023-02-01T02:17:12.594980+00:00", | ||
"umbra:task_id": "fa8af008-6dc6-4382-8f5a-205f5a6af209", | ||
"start_datetime": "2023-02-01T02:17:08.851006+00:00", | ||
"sar:product_type": "GEC", | ||
"sar:looks_azimuth": 1, | ||
"sar:polarizations": [ | ||
"VV" | ||
], | ||
"umbra:collect_ids": [ | ||
"1b454eab-7958-4755-bb6b-797bde214e8d" | ||
], | ||
"sar:frequency_band": "X", | ||
"sar:instrument_mode": "SPOTLIGHT", | ||
"sar:resolution_range": 0.5, | ||
"view:incidence_angle": 59.1085205078125, | ||
"sar:resolution_azimuth": 0.5, | ||
"umbra:open-data-catalog": true, | ||
"umbra:squint_angle_degrees": 180.2089385986328, | ||
"umbra:grazing_angle_degrees": 30.8914794921875, | ||
"umbra:slant_range_kilometers": 939.5191650390625, | ||
"umbra:target_azimuth_angle_degrees": 77.42530059814453, | ||
"umbra:squint_angle_engineering_degrees": -90.20893859863281, | ||
"umbra:squint_angle_exploitation_degrees": -0.2089385986328125, | ||
"umbra:squint_angle_degrees_off_broadside": 0.2089385986328125, | ||
"datetime": null | ||
}, | ||
"links": [ | ||
{ | ||
"rel": "collection", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar", | ||
"type": "application/json" | ||
}, | ||
{ | ||
"rel": "parent", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar", | ||
"type": "application/json" | ||
}, | ||
{ | ||
"rel": "root", | ||
"href": "https://api.canopy.umbra.space/archive/", | ||
"type": "application/json", | ||
"title": "stac-fastapi" | ||
}, | ||
{ | ||
"rel": "self", | ||
"href": "https://api.canopy.umbra.space/archive/collections/umbra-sar/items/192f767c-20f8-4b42-8ea2-d1f60fdaace1", | ||
"type": "application/geo+json" | ||
} | ||
], | ||
"assets": { | ||
"thumbnail": { | ||
"href": "https://api.canopy.umbra.space/archive/thumbnail/192f767c-20f8-4b42-8ea2-d1f60fdaace1", | ||
"type": "image/png", | ||
"title": "Thumbnail for 192f767c-20f8-4b42-8ea2-d1f60fdaace1", | ||
"description": "512x512 PNG thumbnail for 192f767c-20f8-4b42-8ea2-d1f60fdaace1", | ||
"roles": [ | ||
"thumbnail" | ||
] | ||
} | ||
}, | ||
"collection": "umbra-sar" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since pandas is a dependency, maybe
ciso8601
could be dropped as a dependency and instead just use pandas or pyarrow for date handling? see also #31 (comment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely don't want to use pandas here, but using pyarrow natively for the cast is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the only other place
ciso8601
is used currently is in testing herestac-geoparquet/tests/json_equals.py
Lines 107 to 108 in 4b00f5b
Should I switch that to use pandas or
pa.scalar(timestamp_str, type=pa.string()).cast(pa.timestamp('us', tz='UTC')).as_py()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine for ciso8601 to still be used in the tests.