Created
May 22, 2024 07:35
-
-
Save 2tony2/cbcb0b02fde1b8542fcd1943eef5e158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import TypedDict | |
| class DataPipelineConfig(TypedDict): | |
| name: str | |
| batch_size: int | |
| is_active: bool | |
| def display_pipeline_config(config: DataPipelineConfig) -> str: | |
| status = 'active' if config['is_active'] else 'inactive' | |
| return (f"Pipeline {config['name']} with batch size {config['batch_size']} is currently {status}.") | |
| pipeline_config: DataPipelineConfig = { | |
| "name": "User ETL", | |
| "batch_size": 1000, | |
| "is_active": True | |
| } | |
| print(display_pipeline_config(pipeline_config)) | |
| # Output: Pipeline User ETL with batch size 1000 is currently active. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment