Skip to content

Cognition integration provider #167

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

Open
wants to merge 123 commits into
base: dev
Choose a base branch
from

Conversation

andhreljaKern
Copy link
Contributor

@andhreljaKern andhreljaKern commented May 15, 2025

andhreljaKern and others added 26 commits June 25, 2025 09:03
…-ai/refinery-submodule-model into cognition-integration-provider
…-ai/refinery-submodule-model into cognition-integration-provider
…submodule-model into cognition-integration-provider
@@ -197,6 +198,16 @@ def set_parse_cognition_file_task_to_failed(
general.commit()


def set_integration_task_to_failed(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be moved to cognition_objects/integration.py

.filter(
Project.organization_id == organization_id,
Attribute.name.in_(["__ACCESS_GROUPS", "__ACCESS_USERS"]), #
Attribute.name.in_(["__ACCESS_GROUPS", "__ACCESS_USERS"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should one of these 2 filters be removed?

) -> None:
integration = integration_db_bo.get_by_id(integration_id)
if integration:
integration.state = enums.CognitionMarkdownFileState.FAILED.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
integration.state = enums.CognitionMarkdownFileState.FAILED.value
integration_db_bo.update(
integration_id,
state=enums.CognitionMarkdownFileState.FAILED.value,
finished_at=datetime.now(datetime.timezone.utc),
is_synced=False,
error_message=?
)

flag_modified(record_item, "data")
if (i + 1) % 1000 == 0:
general.flush_or_commit(with_commit)
general.flush_or_commit(with_commit)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why commit every time, twice?

@@ -925,3 +944,19 @@ def get_first_no_text_column(project_id: str, record_id: str) -> str:
WHERE r.project_id = '{project_id}' AND r.id = '{record_id}'
"""
return general.execute_first(query)[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typing

}


def get_supported_metadata_keys(table_name: str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
def get_supported_metadata_keys(table_name: str):
def get_supported_metadata_keys(table_name: str) -> set[str]:

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.

4 participants