Closed HarshitNagpal29 closed 10 months ago
BTW, since it is an incompatible change, we should add some comments in https://github.com/apache/dolphinscheduler-sdk-python/blob/1b2ad576eef87430e0abee47cce60eec5a374475/UPDATING.md#L29 we already have some example in that.
And we better add some DeprecationWarning
for the user who still passes old parameter type for it. the old parameter seems like
http = Http(
name="http",
url="http://www.google.com",
http_method="GET",
http_params=[
{"prop": "abc", "httpParametersType": "PARAMETER", "value": "def"}
],
)
And we should raise some warnings and tell users that the format is deprecation
maybe it can be
if isinstance(http_params, list):
warnings.warn(
"The `http_params` parameter currently accept dict instead of list, you parameter is ignore.",
DeprecationWarning,
)
Hi @HarshitNagpal29, it is good to see you add some tests and fantastic docstring in this PR, well done 👍 +1 I had left some new comments for this PR, PTAL if you have time
@zhongjiajie sir i have made all the changes as you mentioned.
Hi @HarshitNagpal29, it is good to see you add some tests and fantastic docstring in this PR, well done 👍 +1 I had left some new comments for this PR, PTAL if you have time
sir please tell me what to do, i am happy to help
@zhongjiajie sir i am looking forward to participate in gsoc 2024 , i am new to open source contribution but i am well aware with javascript, node.js and somewhat python as well , i found your organisation pretty interesting and i am looking forward to contribute more, can you please provide some resources, places where i can connect with mentors more often , and some valuable feedback, i will be really grateful for that. thank you
Great, do you have any resources about gsoc 2024? our project join gsoc 2022 but not in 2023, and I have act as mentor for 2022 too. I want to know the timeline about project submission.
can you please provide some resources, places where i can connect with mentors more often
you can find my email in my GitHub profile and connect me via that.
BTW, we have a code style check for our codebase, you could run the command tox -e auto-lint
to format the code. for more information, you can see in https://github.com/apache/dolphinscheduler-sdk-python/blob/main/CONTRIBUTING.md#code-style-using-tox
and for how to set tox development you can see in https://github.com/apache/dolphinscheduler-sdk-python/blob/main/CONTRIBUTING.md#automated-testing-with-tox
And I have commit and change some code to you branch, so you should pull them to your local before you add your change
@zhongjiajie sir i have made the changes and added some tests as well suggested by you.
@zhongjiajie sir i have mailed you to connect with you
@zhongjiajie sir I am waiting for your response
I approval the CI run
Other LGTM, but it seems you forget to format the code by
too -e auto-lint
Sorry for the inconvenience i will try to do it now.
you can run the command and then append one more commit this this PR
@zhongjiajie sir i don't know why but i am not able to setup and run tox command on my local machine, I have tried a lot really sorry for that but still I have done the formatting, linting, styling and all using black and ruff commands manually, please check if it still needs improvement, again sorry for inconvenience.
I approval CI run. what OS do you use in your local machine?
@zhongjiajie sir i use mac os. Also sir what to do with these CI run which is failing.
@zhongjiajie sir i use mac os. Also sir what to do with these CI run which is failing.
tax should work with macOS, and you should format http.py files because log said
lint: 15588 W commands[0]> python -m black --check . [tox/tox_env/api.py:427]
[549](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:550)
would reformat /home/runner/work/dolphinscheduler-sdk-python/dolphinscheduler-sdk-python/src/pydolphinscheduler/tasks/http.py
[550](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:551)
[551](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:552)
Oh no! 💥 💔 💥
[552](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:553)
1 file would be reformatted, 157 files would be left unchanged.
do you install tox first then trying run command tox -e auto-lint
? and how about the output when you run tox -l
?
@zhongjiajie sir i use mac os. Also sir what to do with these CI run which is failing.
tax should work with macOS, and you should format http.py files because log said
lint: 15588 W commands[0]> python -m black --check . [tox/tox_env/api.py:427] [549](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:550) would reformat /home/runner/work/dolphinscheduler-sdk-python/dolphinscheduler-sdk-python/src/pydolphinscheduler/tasks/http.py [550](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:551) [551](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:552) Oh no! 💥 💔 💥 [552](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7435014085/job/20230557494?pr=130#step:5:553) 1 file would be reformatted, 157 files would be left unchanged.
@zhongjiajie sir I made changes in http.py file using tox , I used different machine with linux as OS , in my mac machine even after installing tox when I was inputting "tox -l" command, it was showing me only version of python that is "312" no file like tox.ini and all, maybe it was some kind of a glitch.
maybe you can remove the project and try clone from the GitHub again after this PR merged
@zhongjiajie ok I will try that method, but do you need any more changes in this pull request
lint still no pass, maybe you can run command python -m ruff check --fix --unsafe-fixes .
to fix it
lint: 16342 W commands[1]> python -m ruff check . [tox/tox_env/api.py:427]
[553](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7438828861/job/20249516885?pr=130#step:5:554)
tests/tasks/test_http.py:167:13: F841 Local variable `http` is assigned to but never used
[554](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7438828861/job/20249516885?pr=130#step:5:555)
Found 1 error.
[555](https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7438828861/job/20249516885?pr=130#step:5:556)
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
@zhongjiajie sir please check it now, i fixed that linting issue and in my machine it is showing me everything fine
@zhongjiajie sir please provide approval now
test error for case test_http_params_deprecation_warning
with link https://github.com/apache/dolphinscheduler-sdk-python/actions/runs/7445619872/job/20284481402?pr=130
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.89%. Comparing base (
f16599f
) to head (3a22ec0
). Report is 9 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @HarshitNagpal29 I add and fix some tests in 3a22ec0
for the test_http_params
we need to mock the return of function gen_code_and_version
which is called with dolphinscheduler code in apache/dolphinscheduler
@patch(
"pydolphinscheduler.core.task.Task.gen_code_and_version",
return_value=(123, 1),
)
and for case test_http_params_deprecation_warning
, w[-1].message
is detail of warnings message, which depend on your warning message in the class Http
Now all CI are green, merging 🎉 thanks for your contribution and looking forward your next contribute
@zhongjiajie sir i am really grateful that i was able to work on this issue with you and learn lot of new things, i am looking forward to contribute more , can you please suggest some good first issues which i can work upon or maybe some documentation changes in this project or some other.
Hi @HarshitNagpal29 here are two of issue maybe good and easy to fix
setValue
and auto add out-put parameter for our code https://github.com/apache/dolphinscheduler-sdk-python/issues/61
…sion
fix: #88
Brief Summary of The Change
Pull Request checklist
I confirm that the following checklist has been completed.
docs/source/config.rst
when you change filedefault_config.yaml
.UPDATING.md
when it is an incompatible change.