Skip to content
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

problem with xlsx import #85

Closed
rCarto opened this issue Aug 31, 2022 · 6 comments
Closed

problem with xlsx import #85

rCarto opened this issue Aug 31, 2022 · 6 comments
Labels
bug It's a bug and we should do something about it.
Milestone

Comments

@rCarto
Copy link
Member

rCarto commented Aug 31, 2022

From comment under https://magrit.hypotheses.org/75

Bonjour,

J’ai depuis hier le message suivant qui s’affiche lorsque j’essaye d’importer un jeu de données via un tableau excel :

Une erreur s’est produite – L’opération en cours a été stoppée.
Détails : Unable to convert the provided file. Please check that it is a tabular file supported by the application (in xls, xlsx, ods or csv format).

J’ai vérifié et le fichier est au bon format, et même avec seulement deux colonnes, une avec les code_insee et l’autre avec les noms de communes cela ne marche pas. Avez-vous une idée de pourquoi ?

@mthh
Copy link
Member

mthh commented Aug 31, 2022

I'm able to reproduce it with xlsx (xls, ods and csv are working fine). I will push / deploy a fix today.

I will also answer on https://magrit.hypotheses.org/75.

@mthh
Copy link
Member

mthh commented Aug 31, 2022

Just for the record, the exception that is raised in Python code is AttributeError: 'ElementTree' object has no attribute 'getiterator'.
Since Python 3.9 xml.etree.ElementTree.Element.getiterator() has been removed, but there is a way to inform xlrd (that is used by pyexcel on which we rely) about that.

@mthh mthh added the bug It's a bug and we should do something about it. label Aug 31, 2022
@mthh mthh added this to the 0.9.0 milestone Aug 31, 2022
@mthh mthh closed this as completed in 6286f75 Aug 31, 2022
@rCarto rCarto changed the title problem with xls import problem with xlsx import Aug 31, 2022
@mthh
Copy link
Member

mthh commented Aug 31, 2022

The new version in now online on https://magrit.cnrs.fr.

@rCarto
Copy link
Member Author

rCarto commented Sep 1, 2022

See https://magrit.hypotheses.org/75#comment-243

  • Add a dataset
  • Import a valid csv file
  • Data type button not enabled
  • Add a geom layer
  • Join data and geom
  • Data type button enabled

It seems that the "Data type / typage des données" button is only enabled when a geom layer is present and joined to the dataset. Not sure it was the case before.
Does it makes sense to enable data typing only when a geom layer is joined (bug or feature)?

@mthh
Copy link
Member

mthh commented Sep 1, 2022

To my knowledge it has always been like that.

I'm not sure I understand the problem (?), specifying the types of the fields of the ("external") data table before the join would be useless because the fields in this data table are not proposed anywhere (i.e. in the menus related to the cartographic representations) at this point.
These fields are only used in Magrit once joined to the target layer.

I think the user had simply forgotten to make a join with his geo dataset (or simply omitted the need for such a dataset).

I'm open to discuss this if I'm not understanding it correctly or if you see a need to do this typing on the data table before the join.

@rCarto
Copy link
Member Author

rCarto commented Sep 1, 2022

So feature then. I think it makes sense to keep it the way it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug and we should do something about it.
Development

No branches or pull requests

2 participants