-
Notifications
You must be signed in to change notification settings - Fork 63
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
Error uploading dataframes #947
Comments
Ei Goizueta! I have just run the notebook and everything goes fine (develop branch). Can you check it? |
The notebook example is working, but dataframes without geometry keep failing. It works for me if I change this: diff --git a/cartoframes/data/dataset/registry/dataframe_dataset.py b/cartoframes/data/dataset/registry/dataframe_dataset.py
index 88c765a2..64d5ad27 100644
--- a/cartoframes/data/dataset/registry/dataframe_dataset.py
+++ b/cartoframes/data/dataset/registry/dataframe_dataset.py
@@ -138,6 +138,8 @@ def _rows(df, cols, with_lnglat, geom_col, enc_type):
lng_val = None
lat_val = None
for col in cols:
+ if col is None:
+ continue
val = row[col]
if _is_null(val):
val = '' |
Regarding the fix, it was failing because in cartoframes/cartoframes/data/dataset/registry/dataframe_dataset.py Lines 77 to 78 in f086eeb
a None is inserted in the list of columns (because no geom column is found) |
... so perhaps this would be a more sensible fix: diff --git a/cartoframes/data/dataset/registry/dataframe_dataset.py b/cartoframes/data/dataset/registry/dataframe_dataset.py
index 88c765a2..a6298630 100644
--- a/cartoframes/data/dataset/registry/dataframe_dataset.py
+++ b/cartoframes/data/dataset/registry/dataframe_dataset.py
@@ -74,7 +74,9 @@ class DataFrameDataset(BaseDataset):
enc_type = _detect_encoding_type(self._df, geom_col)
columns_normalized = []
- columns_origin = [geom_col]
+ columns_origin = []
+ if geom_col:
+ columns_origin.append(geom_col)
for norm, orig in normalized_column_names:
columns_normalized.append(norm)
columns_origin.append(orig) |
Good catch! Thanks, I am going to fix it! |
🤔 for some reason my latest patch doesn't quite fix it:
|
The last cell of the dataset example fails with this error:
I've found the same problem trying to upload other dataframes created with csv files.
The text was updated successfully, but these errors were encountered: