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

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

Conversation

joaoandre-avaiga
Copy link
Collaborator

No description provided.

@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
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?

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.

None yet

2 participants