Commit 68cf35e8 authored by ARCHER's avatar ARCHER

try to fix gdf to df unexpected conversion

see #2
parent 86a1d43f
......@@ -173,7 +173,8 @@ def to_sql(df,*args,**kwargs):
if list(df.keys()) != non_pk_cols:
logger.debug("df columns are not in the same order as existing table. Rearranging them")
try:
df=df[non_pk_cols]
#df=df[non_pk_cols] # convert to std dataframe ? (https://gitlab.ifremer.fr/cyclobs/geopandas_postgis/issues/2)
df=df.reindex(columns=non_pk_cols,copy=False)
except Exception as e:
raise ValueError("Columns mismatch. need more checks for useful debug msg: %s" % str(e))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment