HarshitNagpal29 commented on issue #88:
URL:
https://github.com/apache/dolphinscheduler-sdk-python/issues/88#issuecomment-1873440056
@zhongjiajie sir i tried to transform your given snippet of code in more
pythonic manner you can see below, if you still want some changes then please
tell me , also provide your valuable feedback as well as i am new to to open
source community.
`from typing import List, Dict
class Http:
"""Represents an HTTP request object."""
def __init__(self, name: str, url: str, http_method: str, http_params:
List[Dict[str, str]]):
self.name = name
self.url = url
self.http_method = http_method
self.http_params = http_params
http_params = [
{"prop": "abc", "http_parameters_type": "PARAMETER", "value": "def"},
{"prop": "ghi", "http_parameters_type": "HEADER", "value": "jkl"},
]
http = Http(name="http", url="http://www.google.com", http_method="GET",
http_params=http_params)`
**Changes i made: **
> Introduced List[Dict[str, str]] which provides clear information that
http_params should be a list of dictionaries where each dictionary has string
keys and string values.
> The __init__ method is explicitly defined within the Http class.
> And then some minor changes here and there just to increase readability of
code and make it more pythonic.
Thank You.
--
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]