uranusjr commented on code in PR #27689:
URL: https://github.com/apache/airflow/pull/27689#discussion_r1023399308
##########
airflow/providers/microsoft/psrp/hooks/psrp.py:
##########
@@ -215,11 +216,33 @@ def invoke(self) -> Generator[PowerShell, None, None]:
if local_context:
self.__exit__(None, None, None)
- def invoke_cmdlet(self, name: str, use_local_scope=None, **parameters:
dict[str, str]) -> PowerShell:
+ def invoke_cmdlet(
+ self,
+ name: str,
+ use_local_scope=None,
+ arguments: list[str] | None = None,
+ parameters: dict[str, str] | None = None,
+ **kwargs: str,
+ ) -> PowerShell:
"""Invoke a PowerShell cmdlet and return session."""
+ if kwargs:
+ if parameters:
+ raise ValueError("**kwargs not allowed when 'parameters' is
used at the same time.")
+ warn(
+ "Passing **kwargs to 'invoke_cmdlet' is deprecated "
+ "and will be removed in a future release. Please use
'parameters' "
+ "instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
Review Comment:
I wonder if it is worthwhile to do this rather than just bump the major
version and break compatibility.
--
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]