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

Add Zaragoza spider #510

Merged
merged 3 commits into from Oct 6, 2020
Merged

Add Zaragoza spider #510

merged 3 commits into from Oct 6, 2020

Conversation

aguilerapy
Copy link
Contributor

closes #507

@aguilerapy aguilerapy requested a review from yolile October 5, 2020 03:19
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)
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

kingfisher_scrapy/spiders/spain_zaragoza.py Outdated Show resolved Hide resolved
kingfisher_scrapy/spiders/spain_zaragoza.py Outdated Show resolved Hide resolved
@aguilerapy aguilerapy requested a review from yolile October 5, 2020 17:57
yolile
yolile previously approved these changes Oct 5, 2020
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)
Copy link
Member

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')
Copy link
Member

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
Copy link
Member

@jpmckinney jpmckinney Oct 5, 2020

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?

@yolile yolile merged commit 8288383 into master Oct 6, 2020
@yolile yolile deleted the 507-zaragoza_spider branch October 6, 2020 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zaragoza spider
3 participants