-
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
db: Add query review tables and update QueryExecutionStatus enum #19
Conversation
status = sql.Column( | ||
sql.Enum(QueryReviewStatus), nullable=False, default=QueryReviewStatus.PENDING | ||
) |
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.
for a query review, it will link to a query execution by query_execution_id
, which also contains the review status, it seems duplicate with this review status
to me. maybe
- we dont really need this
QueryReviewStatus
, just use the execution status instead - or for the
QueryExecutionStatus
, we only introduce a generalPENDING
status, but not specific to review pending, and no rejected status. so every execution will start with a PENDING status.
review_request_reason = sql.Column( | ||
sql.String(length=description_length), nullable=True | ||
) | ||
rejection_reason = sql.Column(sql.String(length=description_length), nullable=True) |
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 think request and rejection reason should be both required
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 realized we will only have rejection reason after reviewer rejects, so will make rejection_reason nullable=True for review request creation
) | ||
|
||
if updated: | ||
query_review.updated_at = datetime.datetime.now() |
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 think the update()
function above already handles the update_at
field.
5f4b7e5
to
4e0f81d
Compare
4e0f81d
to
e365c81
Compare
Changes:
|
|
||
@with_session | ||
def get_query_review_from_query_execution_id(query_execution_id: int, session=None): | ||
query_execution = get_query_execution_by_id(query_execution_id, session=session) |
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 go through the route of getting query execution, we could do
QueryReview.get(query_execution_id=query_execution_id, session=session)
d122269
to
76f8903
Compare
e365c81
to
62e53a1
Compare
62e53a1
to
79a01da
Compare
Changes