-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: dev
Are you sure you want to change the base?
Conversation
…ode-kern-ai/refinery-submodule-model into cognition-integration-provider
…ode-kern-ai/refinery-submodule-model into cognition-integration-provider
…-ai/refinery-submodule-model into cognition-integration-provider
…-ai/refinery-submodule-model into cognition-integration-provider
…submodule-model into cognition-integration-provider
Co-authored-by: andhreljaKern <[email protected]>
@@ -197,6 +198,16 @@ def set_parse_cognition_file_task_to_failed( | |||
general.commit() | |||
|
|||
|
|||
def set_integration_task_to_failed( |
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.
should be moved to cognition_objects/integration.py
business_objects/project.py
Outdated
.filter( | ||
Project.organization_id == organization_id, | ||
Attribute.name.in_(["__ACCESS_GROUPS", "__ACCESS_USERS"]), # | ||
Attribute.name.in_(["__ACCESS_GROUPS", "__ACCESS_USERS"]), |
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.
should one of these 2 filters be removed?
business_objects/monitor.py
Outdated
) -> None: | ||
integration = integration_db_bo.get_by_id(integration_id) | ||
if integration: | ||
integration.state = enums.CognitionMarkdownFileState.FAILED.value |
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.
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) |
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 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] |
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.
typing
integration_objects/helper.py
Outdated
} | ||
|
||
|
||
def get_supported_metadata_keys(table_name: str): |
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.
def get_supported_metadata_keys(table_name: str): | |
def get_supported_metadata_keys(table_name: str) -> set[str]: |
Main PR: code-kern-ai/refinery-gateway#302