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 retry methods and queries on sql repository #1320

Closed
wants to merge 2 commits into from

Conversation

joaoandre-avaiga
Copy link
Collaborator

No description provided.

@joaoandre-avaiga joaoandre-avaiga requested a review from jrobinAV May 25, 2024 22:42
@joaoandre-avaiga joaoandre-avaiga force-pushed the fix/sqlrepo-integration-test branch 2 times, most recently from a80efd9 to fcb17da Compare May 26, 2024 00:46
Copy link
Contributor

github-actions bot commented May 26, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18497 16113 87% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/core/_repository/_sql_repository.py 85% 🟢
taipy/core/_version/_version_model.py 100% 🟢
taipy/core/cycle/_cycle_model.py 100% 🟢
taipy/core/data/_data_model.py 100% 🟢
taipy/core/job/_job_model.py 100% 🟢
taipy/core/scenario/_scenario_model.py 100% 🟢
taipy/core/submission/_submission_model.py 100% 🟢
taipy/core/task/_task_model.py 100% 🟢
TOTAL 98% 🟢

updated for commit: 7a02411 by action🐍

query = self.table.select().filter_by(id=entity_id).order_by(text("updated_at DESC"))

for _ in range(self.MAX_MODEL_NOT_FOUND_RETRY):
if entry := self.db.execute(str(query.compile(dialect=sqlite.dialect())), [entity_id]).fetchall():
Copy link
Member

Choose a reason for hiding this comment

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

The behavior we want is to have at most one element returned by this query.
We should at least log a warning if it is not the case.
To investigate why, maybe we can exit as well.

taipy/core/_repository/_sql_repository.py Show resolved Hide resolved
@joaoandre-avaiga joaoandre-avaiga force-pushed the fix/sqlrepo-integration-test branch from fcb17da to 26f7a7f Compare June 20, 2024 01:10
IndexError,
StopIteration,
)
MAX_MODEL_NOT_FOUND_RETRY = 30
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it too much? Or is it for debugging and investigation purpose?

@joaoandre-avaiga
Copy link
Collaborator Author

@jrobinAV I think Im not gonna merge this PR while we discuss about removing sql.

@jrobinAV
Copy link
Member

All right. Sounds fair.

@jrobinAV
Copy link
Member

Since we decided to remove the sql option for repository type, should we close the PR and delete the branch ?

@jrobinAV jrobinAV added Core Related to Taipy Core Core: Repository labels Jul 23, 2024
@joaoandre-avaiga
Copy link
Collaborator Author

Closing this since we decided to remove SQL Repository

@joaoandre-avaiga joaoandre-avaiga deleted the fix/sqlrepo-integration-test branch September 10, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: Repository Core Related to Taipy Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants