Skip to content

Conversation

@throuxel
Copy link
Member

@throuxel throuxel commented Jan 6, 2026

Proposed changes

This PR introduces a deprecation handling system for the connectors SDK, managing automatically different use-cases while maintaining backward compatibility.

  • LegacyField(): Mark fields as deprecated with migration metadata
  • DeprecatedNameSpace & DeprecatedVariable: Annotated types for deprecated configurations
  • Automatic migration via migrate_deprecation() validator in BaseConnectorSettings
  • Support for variable renaming, namespace migration, and value transformation
  • User-friendly deprecation warnings

Exemple:

class MyConfig(BaseConfigModel):
   old_var: DeprecatedVariable = LegacyField(
       deprecated="Use new_var instead",
       new_variable_name="new_var",
       change_value=lambda x: x * 60  # Optional transformation
   )
   new_var: int = Field(description="New variable")

class ConnectorSettings(BaseConnectorSettings):
   old_namespace: DeprecatedNameSpace = LegacyField(
       deprecated="Use new_namespace instead",
       new_namespace="new_namespace"
   )
   new_namespace: MyConfig = Field(default_factory=MyConfig)

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

The dummy connector is only for demo, and should be removed before merging.

@throuxel throuxel self-assigned this Jan 6, 2026
@throuxel throuxel added filigran team use to identify PR from the Filigran team do not merge Do not merge this PR until this tag will be removed improvement connectors-sdk labels Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

connectors-sdk do not merge Do not merge this PR until this tag will be removed filigran team use to identify PR from the Filigran team improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants