Closed jorisvandenbossche closed 3 months ago
Enabling logging gives:
WARNING:fiona.ogrext:Skipping field b: invalid type (11, 0, 'Timestamp')
This is because of using type(value).__name__
to get the name of the type in the fieldkey
lookup for the setter function (from https://github.com/Toblerity/Fiona/pull/1366/files#diff-10438bbcfe51863df4f21eb3b3ef0782ab5289899b0d408e220bf7ae43c67648R763)
@jorisvandenbossche thanks for the report. Sorry about this, I'll make sure it's fixed for 1.10b1.
GeoPandas CI is green again!
Example that works with released fiona, using a
pd.Timestamp
scalar in the data passed towriterecords
for a "datetime" field:Starting with 1.10 a2, this seems to silently drop that column:
If I use
datetime.datetime.fromisoformat(..)
instead ofpd.Timestamp(..)
in the code above (i.e. passing adatetime.datetime
object), then it works again. Butpd.Timestamp
is subclass ofdatetime.datetime
(and so things likeisinstance(value, datetime.datetime)
should work), and this worked in the past.We are running into this issue in GeoPandas' CI because we pass the result of
GeoDataFrame.iterfeatures()
towriterecords
. And it seems that this is creating a json-like structure that usespd.Timestamp
instead ofdatetime.datetime
objects.