Skip to content

Commit a5e1fb2

Browse files
Fix for polars 1.33.0 (dtype becoming mandatory)
1 parent d2f3cd4 commit a5e1fb2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

intake_esm/cat.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,10 @@ def _read_csv_pl(self) -> FramesModel:
662662
.str.replace('^.', '[') # Replace first/last chars with [ or ].
663663
.str.replace('.$', ']') # set/tuple => list
664664
.str.replace(',]$', ']') # Remove trailing commas
665-
.str.replace_all("'", '"')
666-
.str.json_decode() # This is to do with the way polars reads json - single versus double quotes
665+
.str.replace_all(
666+
"'", '"'
667+
) # This is to do with the JSON spec- single versus double quotes
668+
.str.json_decode(dtype=pl.List(pl.Utf8))
667669
for colname in converters.keys()
668670
]
669671
)

0 commit comments

Comments
 (0)