-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add aggregator parser #3196
Add aggregator parser #3196
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Codecov ReportBase: 97.94% // Head: 98.10% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3196 +/- ##
==========================================
+ Coverage 97.94% 98.10% +0.16%
==========================================
Files 273 275 +2
Lines 19262 19767 +505
==========================================
+ Hits 18866 19393 +527
+ Misses 396 374 -22
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
676e222
to
c781dca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je fais un première review, il manque le changelog. Je regarde le reste plus tard.
@@ -12,7 +12,7 @@ class Command(BaseCommand): | |||
|
|||
def add_arguments(self, parser): | |||
parser.add_argument('parser', help='Parser class name in var/conf/parsers.py (or dotted syntax in python path)') | |||
parser.add_argument('shapefile', nargs="?") | |||
parser.add_argument('filename', nargs="?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be documented (in install/imports.rst maybe)
0a81e3b
to
6819ccd
Compare
@@ -12,7 +12,7 @@ class Command(BaseCommand): | |||
|
|||
def add_arguments(self, parser): | |||
parser.add_argument('parser', help='Parser class name in var/conf/parsers.py (or dotted syntax in python path)') | |||
parser.add_argument('shapefile', nargs="?") | |||
parser.add_argument('filename', nargs="?", help='Optional file which will be use to feed database') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser.add_argument('filename', nargs="?", help='Optional file which will be use to feed database') | |
parser.add_argument('filename', nargs="?", help='Optional file used to feed database') |
plus court, c'est mieux
bdd9d28
to
6661937
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je continue de lire et essayer de tout comprendre, voilà déjà des retours
|
||
class GeotrekParser(AttachmentParserMixin, Parser): | ||
""" | ||
url_categories: url of the categories in api v2 (example: 'category': '/api/v2/touristiccontent_category/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est peut-être plus "anglais" de dire "categories url", et donc la variable categories_url
, mais rien d'obligatoire non plus
geom = GEOSGeometry(geom) | ||
return geom | ||
|
||
def next_row(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est-ce que tu peux expliciter dans la docstring pourquoi on a besoin de surcharger cette méthode ?
et notamment l'usage de self.next_url
""" | ||
model = None | ||
next_url = '' | ||
url = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Préciser quelque part que c'est mieux sans le /
à la fin, sinon ça ne fonctionne pas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça peut être dans le message d'erreur par exemple
geotrek/trekking/parsers.py
Outdated
|
||
def next_row(self): | ||
self.next_url = f"{self.url}/api/v2/trek" | ||
return super().next_row() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peut-être qu'avec une variable endpoint_url
ou un truc comme ça, y a moyen de ne pas être obligé de surcharger cette méthode ?
J'ai eu une pensée pour le fait que le GTA aggrégateur et les GTAs aggrégés doivent être sur la même version du code. Comme il y aura forcément des moments où ce ne sera pas le cas (brièvement, par exemple pour les màj). Je me dis que l'avoir en tête au niveau de la gestion des erreurs est pas mal. Pour échouer gracieusement. |
c1883ac
to
9ca79e7
Compare
Quelques retours après tests sur des APIs en 2.85.0 et en 2.82.2 Globalement ça fonctionne bien et c'est assez simple à mettre en oeuvre Messages :
Attachments :
Suppression des contenus : Import différentiel : GeotrekSignageParser:
GeotrekTouristicContentParser:
|
Tu as regardé avec les dernières modifications ? |
Je viens de mettre à jour Geotrek et de re-tester et j'ai toujours le même comportement. class DemoGeotrekPOIParser(GeotrekPOIParser):
delete = False
url = "https://geotrekdemo.ecrins-parcnational.fr" |
Autre point, je m'interroge sur la gestion des structures, pour le moment, si je ne me trompe pas elles ne sont pas prisent en compte. |
ce6985e
to
983bfd6
Compare
En effet il y avait une erreur. La gestion de la suppression fonctionne dorénavant. |
Add 'provider' field to aggregated models
No description provided.