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

PR for hw4 #3

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Nimbleredsquirrel
Copy link

No description provided.

Copy link

@belou5ov belou5ov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом ок.
9 баллов.
Хотелось бы видеть plpython и обработку ошибок при выполнении запросов.

query = f"""[out:json][date:'{str(year)}-01-01T00:00:00Z'][maxsize:2000000000];
area["name:en"="{town}"]->.searchArea;
(node["natural"="tree"](area.searchArea);); out count;"""
result = requests.post(url, data=query, timeout=60)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут стоит обрабатывать ошибки.

@@ -0,0 +1,20 @@
CREATE EXTENSION IF NOT EXISTS plpython3u;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем plpython3u, если используешь plpgsql ?

class Trees(Base): # pylint: disable=R0903
"""Template from database."""

__tablename__ = "Trees"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше писать имена таблиц в нижнем регистре.

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.

2 participants