Skip to content

[SYNPY-1872] Deprecate migrate functions#1427

Merged
andrewelamb merged 8 commits into
developfrom
SYNPY-1872-2
Jul 22, 2026
Merged

[SYNPY-1872] Deprecate migrate functions#1427
andrewelamb merged 8 commits into
developfrom
SYNPY-1872-2

Conversation

@andrewelamb

Copy link
Copy Markdown
Contributor

Problem:

The migrate functions/class in synapseutils needed to be deprecated.

Solution:

These were deprecated, pointing to the new functions/class they should be using.

@andrewelamb
andrewelamb requested a review from a team as a code owner July 16, 2026 14:53
@andrewelamb andrewelamb changed the title deprecated migrate functions [SYNPY-1872] Deprecated migrate functions Jul 16, 2026

@linglp linglp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But I noticed that there's minor inconsistentcy if you check class StorageLocationConfigurableSynchronousProtocol(Protocol):

  def index_files_for_migration(
      self,
      dest_storage_location_id: int,   # <-- typed as int
      ...

this is marked as integer but here it seems like this is a string? And also, the example in the protocol also uses integer instead of string.

@andrewelamb andrewelamb changed the title [SYNPY-1872] Deprecated migrate functions [SYNPY-1872] Deprecate migrate functions Jul 17, 2026
@andrewelamb

Copy link
Copy Markdown
Contributor Author

But I noticed that there's minor inconsistentcy if you check class StorageLocationConfigurableSynchronousProtocol(Protocol):

  def index_files_for_migration(
      self,
      dest_storage_location_id: int,   # <-- typed as int
      ...

this is marked as integer but here it seems like this is a string? And also, the example in the protocol also uses integer instead of string.

Was this comment meant for a different PR?

@linglp

linglp commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@andrewelamb It was meant for this PR here! I saw that you have the following example:

        # The new MigrationResult is returned by the migration methods on the
        # Project and Folder models
        result = Project(id="syn123").index_files_for_migration(
            dest_storage_location_id="12345", --> string 
        )

as the new example. But when I checked class StorageLocationConfigurableSynchronousProtocol(Protocol), I saw:

    def index_files_for_migration(
        self,
        dest_storage_location_id: int, --> int
        db_path: Optional[str] = None,
        *,
        source_storage_location_ids: Optional[List[int]] = None,
        file_version_strategy: str = "new",
        include_table_files: bool = False,
        continue_on_error: bool = False,
        synapse_client: Optional[Synapse] = None,
    ) -> "MigrationResult":

Also here index_files_for_migration_async marks dest_storage_location_id as integer too :

    async def index_files_for_migration_async(
        self,
        dest_storage_location_id: int, 
        db_path: Optional[str] = None,
        *,
        source_storage_location_ids: Optional[List[int]] = None,
        file_version_strategy: str = "new",
        include_table_files: bool = False,
        continue_on_error: bool = False,
        synapse_client: Optional[Synapse] = None,
    ) -> MigrationResult:

Should we update the example docstring in your PR to use integer?

@thomasyu888 thomasyu888 left a comment

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.

🔥 LGTM and I defer to @danlu1 and @BryanFauble for a final review here.

Dan contributed the new migration features

@danlu1 danlu1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this. Just a few comments.

Comment thread synapseutils/migrate_functions.py Outdated
&nbsp;

Use the index_files_for_migration method on the Project or Folder models
from synapseclient.models instead. The new method is called on the model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
from synapseclient.models instead. The new method is called on the model
from synapseclient.models.services instead. The new method is called on the model

Comment thread synapseutils/migrate_functions.py Outdated
Comment thread synapseutils/migrate_functions.py Outdated
andrewelamb and others added 5 commits July 22, 2026 09:09
Co-authored-by: Dan Lu <90745557+danlu1@users.noreply.github.com>
Co-authored-by: Dan Lu <90745557+danlu1@users.noreply.github.com>
Co-authored-by: Dan Lu <90745557+danlu1@users.noreply.github.com>
@andrewelamb
andrewelamb merged commit 0058ba0 into develop Jul 22, 2026
17 of 23 checks passed
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