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

Feat update schemas #803

Merged
merged 13 commits into from
Sep 6, 2023
Merged

Feat update schemas #803

merged 13 commits into from
Sep 6, 2023

Conversation

nrjadkry
Copy link
Member

@nrjadkry nrjadkry commented Sep 5, 2023

No description provided.

@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 09:22 — with GitHub Actions Inactive
@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 10:00 — with GitHub Actions Inactive
@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 10:52 — with GitHub Actions Inactive
@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 11:04 — with GitHub Actions Inactive
@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 11:20 — with GitHub Actions Inactive
@nrjadkry nrjadkry temporarily deployed to test September 5, 2023 11:31 — with GitHub Actions Inactive
Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

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

Looks great - good stuff 👍
I can't test it right now, but I left a few comments

hashtags: List[str] = None
organisation_id: int = None
organisation_logo: str = None
title: Optional[str]
Copy link
Member

Choose a reason for hiding this comment

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

I haven't gone through all of the docs for Pydantic V2, but I think the syntax might be:

title: Optional[str] = None as Optional params still need a default value.


# Fetch the first row of the result
db_organisation = result.fetchone()
# Use SQLAlchemy's query-building capabilities
Copy link
Member

Choose a reason for hiding this comment

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

Try to avoid using SQLAlchemy, as we will remove it in the future.
The raw SQL equivalent is probably best 👍

result = db.execute(query)
tasks = [task[0] for task in result.fetchall()]
return tasks
query = text("""
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the SQL wrapped in text? That locks it in a bit more to SQLAlchemy

Copy link
Member Author

Choose a reason for hiding this comment

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

We have used sqlalchemy db session. it was not required in the previous stage. But, it is required since your latest update. It might be because of pydantic??

Copy link
Member

Choose a reason for hiding this comment

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

No it's not related to pydantic, but there is no harm having the text() there for now if it works.
We can refactor when we remove SQLAlchemy.

@nrjadkry nrjadkry temporarily deployed to test September 6, 2023 11:39 — with GitHub Actions Inactive
@robsavoye robsavoye added bug Something isn't working blocker labels Sep 6, 2023
@robsavoye robsavoye merged commit 8d696be into development Sep 6, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants