Skip to content

Feature: Data export and imports#877

Merged
kalisp merged 260 commits intodevelopfrom
feature/data_imports
Apr 22, 2026
Merged

Feature: Data export and imports#877
kalisp merged 260 commits intodevelopfrom
feature/data_imports

Conversation

@kalisp
Copy link
Copy Markdown
Member

@kalisp kalisp commented Mar 16, 2026

This PR contains functionality for export and imports of various entities into CSV files.

Currently implemented:

  • users
  • folders
  • tasks
  • folder hierarchy

It supports selection of exportable fields, behavior of imports (fail, skip errors) etc.

Technical details

Moved out of ayon-power-pack https://github.com/ynput/ayon-power-pack/pull/58 as it should be part of server backend.

Additional context

@kalisp kalisp requested a review from martastain March 16, 2026 12:59
@kalisp kalisp self-assigned this Mar 16, 2026
Comment thread api/data_import/export_data.py Dismissed
Comment thread api/data_import/export_data.py Fixed
Comment thread api/data_import/export_data.py Fixed
Comment thread api/data_import/models.py Fixed
Comment thread api/data_import/models.py Fixed
Comment thread api/data_import/import_data.py Fixed
Comment thread api/data_import/import_data.py Outdated
Comment thread api/data_import/router.py Outdated
Comment thread api/data_import/import_data.py
Comment thread api/data_import/import_data.py Outdated
Comment thread api/data_import/models.py Outdated
Comment thread api/data_import/models.py Outdated
Comment thread api/data_import/models.py Outdated
Comment thread api/data_import/import_data.py Fixed
Comment thread api/data_import/import_data.py Fixed
kalisp and others added 4 commits March 16, 2026 17:34
…mplicit (fall through) returns'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread api/data_import/export_data.py Fixed
@kalisp kalisp marked this pull request as ready for review March 16, 2026 17:08
Comment thread api/data_import/export_data.py Fixed
Comment thread api/data_import/models.py Fixed
Comment thread api/data_import/export_data.py Dismissed
Comment thread api/data_import/import_data.py Fixed
Comment thread api/data_import/import_data.py Fixed
@kalisp kalisp requested a review from martastain April 21, 2026 13:18
Comment thread api/data_import/common.py Outdated
Comment thread api/data_import/import_data.py Outdated
Comment thread api/data_import/export_data.py Outdated
from ayon_server.settings.anatomy.templates import Templates
from ayon_server.settings.common import BaseSettingsModel
from ayon_server.settings.settings_field import SettingsField
from ayon_server.settings.validators import ensure_unique_names
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure this is a good idea: I believe ensure_unique_names is a validator already used in addons. ensure_unique_property is fine, but we need to keep the original as well (that would under the hood just call ensure_unique_property)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Returned back.

Comment thread ayon_server/helpers/get_entity_class.py Outdated
Comment thread api/data_import/export_data.py Outdated


@router.post("/import/{import_type}")
async def import_data(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not critical, but I'd prefer using Annotated with explicit Query field to denote that the parameter comes from the query parameter - it also allows you to add regex validators for string fields easily.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Didnt understand. What should be Annotated?

Comment thread api/data_import/export_data.py Fixed
Comment thread api/data_import/export_data.py Fixed
Comment thread api/data_import/import_data.py Fixed
return value

@validator("folder_types", "task_types", "statuses")
def ensure_unique_short_names(cls, value, field):
@kalisp kalisp requested a review from martastain April 22, 2026 13:14
Comment thread api/data_import/import_data.py Fixed
@kalisp kalisp merged commit c617078 into develop Apr 22, 2026
6 checks passed
@kalisp kalisp deleted the feature/data_imports branch April 22, 2026 14:31
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.

YN-0350: csv bulk import / update

5 participants