-
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
The current implementation of upgrade_document has the following signature:
def upgrade_document(
document: Any, v1_only: bool, v1_1_only: bool, output_dir: str, imports: Set[str]
) -> Any:IMO it is not scalable for future releases because the new parameter should be added for each release version.
How about fixing the signature as follows?
def upgrade_document(
document: Any, target_version: Optional[str] = "latest", output_dir: str, imports: Set[str]
) -> Any:The target_version parameter takes a version string such as "v1.0", "v1.1", "v1.2" and "latest" (same as "v1.2").
It enables upgrading upgrade_document to other future release versions without changing its signature.
If it is OK for this change, I will send a pull request for it.
Metadata
Metadata
Assignees
Labels
No labels