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

Added part of data from Alfalfa catalog to the test server #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

azzzile
Copy link
Contributor

@azzzile azzzile commented Aug 27, 2024

Loaded columns info

NO ucd was found in tables

Вероятно реально его докрутить и просто попарсить немного, вопрос, нужно ли это


offset = 0
batch = 500
test_limit = 1000
Copy link
Member

Choose a reason for hiding this comment

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

тут же вроде не надо, строк-то не оч много?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

если сразу всю табличку закидывать, мне все равно будет банить с request entity too large

Copy link
Contributor Author

Choose a reason for hiding this comment

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

я максимум ~3к объектов за раз могу грузить

Copy link
Member

Choose a reason for hiding this comment

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

тут речь не про батч, а про test_limit)

import numpy as np


df = pd.read_csv("./alfalfa/tables/raw_info.csv", sep=" ", engine="python")
Copy link
Member

Choose a reason for hiding this comment

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

давай сделаем это параметром из командной строки? чтобы если путь поменялся можно было бы легко поменять а не по коду искать

хорошая и простая библиотека для таких штук click
https://click.palletsprojects.com/en/8.1.x/quickstart/#basic-concepts-creating-a-command
https://click.palletsprojects.com/en/8.1.x/quickstart/#adding-parameters

return np.nan
return row["Name"]

data = pd.read_csv("./alfalfa/tables/main_data.csv")
Copy link
Member

Choose a reason for hiding this comment

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

и это тоже давай аргументом командной строки

Copy link
Member

Choose a reason for hiding this comment

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

и тут тоже давай пути сделаем click-ом сразу

Copy link
Member

Choose a reason for hiding this comment

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

Кстати параметры базы данных тоже можно туда утащить через переменные окружения: https://click.palletsprojects.com/en/8.1.x/arguments/#environment-variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

а их кликом доставать или как было: host=os.getenv("HYPERLEDA_DB_HOST") и тд?

Copy link
Member

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