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 Zaragoza spider #510
Add Zaragoza spider #510
Conversation
if self.from_date and self.until_date: | ||
before = self.from_date.strftime("%Y-%m-%d") + 'T00:00:00Z' | ||
after = self.until_date.strftime("%Y-%m-%d") + 'T00:00:00Z' | ||
url = url + '&before={}&after={}'.format(before, after) |
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.
no debería ser al revés? before until_date and after from_date?
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.
Si, debe ser al revés, pero creo que en el servicio esta así, after=2020-10-05 y before=2000-01-01 con datos, y after=2000-01-01 y before=2020-10-05 sin datos.
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.
Can you add a comment in the code, saying the before
and after
query string parameters behave opposite expectations? Otherwise, I'm sure a future reader will again ask the question.
if self.from_date and self.until_date: | ||
before = self.from_date.strftime("%Y-%m-%d") + 'T00:00:00Z' | ||
after = self.until_date.strftime("%Y-%m-%d") + 'T00:00:00Z' | ||
url = url + '&before={}&after={}'.format(before, after) |
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.
Can you add a comment in the code, saying the before
and after
query string parameters behave opposite expectations? Otherwise, I'm sure a future reader will again ask the question.
for contracting_process_id in ids: | ||
|
||
# A JSON array of ids strings | ||
url = self.url + contracting_process_id.get('id') |
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.
Why get
and not []
? If the id
key isn't set, then get
returns None
, and str + None
is a more confusing error (TypeError) than if we used []
(KeyError).
ids = json.loads(response.text) | ||
for contracting_process_id in ids: | ||
|
||
# A JSON array of ids strings |
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.
I don't see any JSON arrays of strings. Maybe delete the comment?
closes #507