-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/database #52
Feature/database #52
Conversation
720c7d1
to
e5dd662
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.
add some review comment
7950ee3
to
aee93fb
Compare
@quanpython cc: @itutu-tienday dev container is OK. But prod container still fails with following errors.
|
sortOptions: SortOptions = Depends(), | ||
db: Session = Depends(get_db), | ||
): | ||
data = paginate( |
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.
If there is no particular reason, it would be good to wrap the search_db_cells() function.
options: ExpDbExperimentsSearchOptions = Depends(), | ||
sortOptions: SortOptions = Depends(), | ||
): | ||
data = paginate( |
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.
"experiments_share_users" table is not used. Please use it.
- If you are an administrator role, all data of your organization is displayed. If you are a non-administrator role, only the data allowed by experiments_share_users table is displayed.
- For the table of roles, please refer to the following
options: ExpDbExperimentsSearchOptions = Depends(), | ||
sortOptions: SortOptions = Depends(), | ||
): | ||
data = paginate( |
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.
When using the "experiments_share_users" table, an authentication operation (token parsing) process is required to identify the user_id.
Since it would be more efficient to omit the passing of authentication token during development, we would like to have a mode in which the passing of authentication token can be omitted (i.e., a mode in which token and user_id for debugging can be used).
if not exp: | ||
raise HTTPException(status_code=404) | ||
exp.publish_status = int(flag == PublishFlags.on) | ||
db.add(exp) |
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.
"Data publish" is updating experiments.publish_status, not adding records, but are you creating a new experiments in the following?
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.
exp
is an existing experiment object from the database. So db.add(exp)
line adds the modified experiment to the database session to update it rather than create a new one.
To avoid misunderstandings, if the experiment object is already associated with the database session, it is better to omit the db.add(exp)
line.
Thank you.
db.query(optinist_model.Experiment) | ||
.join( | ||
common_model.Organization, | ||
common_model.Organization.id == optinist_model.Experiment.organization_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.
users.organizasion_id and also requires a join, do you have any discrepancies in perception?
if not exp: | ||
raise HTTPException(status_code=404) | ||
exp.share_type = data.share_type | ||
db.add(exp) |
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.
- "Data publish" is updating experiments.publish_status, not adding records, but are you creating a new experiments in the following?
- There are multiple data parameters, and for the experiments_share_users table, the operation is to replace all existing data (delete all -> register all).
@ReiHashimoto |
@quanpython |
MYSQL_USER=docker | ||
MYSQL_PASSWORD=docker | ||
ECHO_SQL=True | ||
DATABASE_URL=mysql+pymysql://docker:docker@db/docker |
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.
Some of the data in DATABASE_URL and MYSQL_* are duplicated, is it possible to manage them smartly in one place?
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.
Yes. Just use MYSQL_* is enough because DATABASE_URL is generate from assemble_db_connection
function in studio/app/common/db/config.py
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.
Still required changes exists, approve for now.
0b4afd1
to
19501db
Compare
No description provided.