Fury0508 commented on PR #60193:
URL: https://github.com/apache/airflow/pull/60193#issuecomment-3733676384
@bugraoz93 I've simplified the implementation as you suggested:
**Changes made:**
1. Removed the if/else branching from `_create_arg` - it's now a simple
"dummy" builder that just creates an Arg with the provided values
2. The caller now determines both `arg_flags` AND `arg_dest` using one-liner
conditionals:
```python
arg_flags = (sanitized_field,) if is_required and not is_bool else ("--"
+ sanitized_field,)
arg_dest = _UNSET if is_required and not is_bool else sanitized_field
```
3. Updated all three call sites in the codebase to pass the `arg_dest`
parameter
The `_create_arg` method is now unaware of the positional/optional logic -
all decision-making happens in the caller as you recommended.
Let me know if this looks good!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]