Commit Graph

111 Commits

Author SHA1 Message Date
JieguangZhou
32a5ccac72
[python] Add custom log for meanful an easier log formatter (#8901)
* Change logging.warning to logger.warning
* Add testing for logging about task code already in process definition

close: #8258
2022-03-15 19:16:33 +08:00
天仇
a308fa3bef
[Feature-8591][Python] Add pre-commit to run basic test before commit (#8843)
* add `.pre-commit-config.yaml` in the pydolphinscheduler module and configured basic check rules like `isort`, `black`, `flake8`
* add some instructions in `DEVELOP.MD`
* Fix some mistake and add some docs on it

Co-authored-by: Jiajie Zhong <zhongjiajie955@hotmail.com>
2022-03-14 20:51:55 +08:00
Jiajie Zhong
90f9aed11d
[python] Add tox for out of box test (#8837)
* [python] Add tox for out of box test

* Add `tox` for easy and complete test
* Correct package data attribute
* Add more dirs in flake8 ignore

* Change GA from raw to tox

* Fix env setter

* Temp skip sanity

* Rm not exists job

* Add code test

* fix

* rm all need

* fix

* fix

* fix

* fix

* fix

* fix

* Migrate pip upgrede to tox setting

* Change install_commands to commands

* fix config of install command

* Add GA env to do that

* Fix env error

* Finial commit

* remove duplicate

* Change doc

* Change dependence of ci

* Change dependence of ci
2022-03-12 21:27:36 +08:00
Jiajie Zhong
fb772c328d
[python] Change name to_string to __str__ and add __repr__ (#8830)
* Change `yaml_parser.py` method `to_string` to magic method
  `__str__` make it more pythonic.
* Add some tests to magic method `__str__` and `__repr__`
2022-03-12 20:36:51 +08:00
Jiajie Zhong
62e12c73dc
[python] Add LICENSE and NOTICE to python dist package (#8768)
* Add LICENSE and NOTICE to Python API
* Add new license dir `python-api-license` to keep all
  Python API's LICENSE files
* Change LICENSE in distribute package
* Add content about should add LICENSE when new dependence
  adding
2022-03-09 19:50:43 +08:00
Jiajie Zhong
5c640789c3
[python] refactor yaml file parser (#8701)
* [python] refactor yaml file parser

* Change yaml parser package to ruamel.yaml
* Refactor configuration.py module
* And file.py to write file locally
* Add more tests on it

close: #8593

* Fix UT error

* Remove pypyaml from tests

* Fix file error when param create is False

* Fix error logic
* And tests to avoid regression
2022-03-07 11:42:28 +08:00
Jiajie Zhong
aac960d3d2
[python] Increase UT coverage threshold to 0.9 (#8660)
This patch increase Python API unit test coverage
threshold from 85% to 90%. If coverage under 90%
will failed our the test
2022-03-03 12:20:34 +08:00
Jiajie Zhong
f256f3ec6e
[python] Fix source and issue tracker link in PyPI (#8638)
* [python] Fix source and issue tracker link in PyPI

This patch fix error or wrong link in
https://pypi.org/project/apache-dolphinscheduler/

* Fix style
2022-03-02 10:44:18 +08:00
Jiajie Zhong
ec4ce2b573
[python] Add config mechanism and cli subcommand config (#8585)
* [python] Add config mechanism and cli subcommand config

* Add configuration.py mechanism for more easy change config
  and move some configs to it. It mechanism including
  configuration.py module and default_config.yaml file
* Add `config` for cli subcommand allow users initialize, get,
  set configs

close: #8344

* Change setup.py format
2022-03-01 11:16:44 +08:00
Jiajie Zhong
36964c2b5a
[deploy] Make Python API as independent directory in release's dist (#8470)
This patch add python api package as independent
directory in final dist directory when user run
command `mvn -U install package -Prelease`.

There have `tar.gz` and `whl` in the python dist directory

```
<the-old-dist-package>
python
  |--- python-independent-pkg.tar.gz
  |--- python-independent-pkg.whl
```

close: #8343

* Give dedicated control to docker build/push goals

Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
2022-02-25 11:06:26 +08:00
xiangzihao
891a002bea
[Feature-#8373][MasterServer] Dependent tasks can re-run automatically in the case of complement (#8496)
* first add feature_8373

* fix code smell

* add blank line

* fix some problems

* fix unit test error
2022-02-25 10:34:02 +08:00
caishunfeng
84f2cfec39
[Feature][Server] Custom timezone - Add timezone handler unified (#8477)
* date convert of timezone

* remove @JsonFormat

* add unit test

* fix time preview in scheduler

* optimization & add env config

Co-authored-by: caishunfeng <534328519@qq.com>
2022-02-24 18:20:34 +08:00
Jiajie Zhong
3025f67d37
[python] Add mechanism cli only with version as subcommand (#8516)
* Add basic cli mechanism with Click, for now just including
  one single subcommand `version`
* Add general and easy test class in tests/testing/cli, and
  test to version
* Add sphinx-click to general cli docs basic on click
2022-02-24 16:05:55 +08:00
kezhenxu94
fa19006a18
Add a property to enable/disable metrics module (#8484) 2022-02-24 10:21:47 +08:00
Eric Gao
49a1270ef5
[Feature-8222][python] move examples into the scope of source package (#8340) 2022-02-14 15:07:00 +08:00
Jiajie Zhong
0c1f664884
[python][chore] Add pypi related info badge to readme (#8294) 2022-02-07 22:09:28 +08:00
Jiajie Zhong
01936a660e
[python] Fix python api can't connect to remote gateway server (#8248)
For now, python API could only communicate python gateway server
in the same hosts, this patch makes it could work with different hosts,
and export java gateway setting to configure file

Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
Co-authored-by: ruanwenjun <861923274@qq.com>
2022-01-29 16:48:18 +08:00
Jiajie Zhong
f3d663a7ea
[python] Clean deps and prepare release (#8210)
* Change package name
* Migrate requirement*.txt to setup.py
* Add extra required for dev
* Add doc RELEASE and DEVELOP
* Correct description
2022-01-28 10:12:00 +08:00
Jiajie Zhong
35578efd08
[python] Initiate document for pydolphinscheduler (#8005) 2022-01-26 12:37:57 +08:00
Kerwin
103ccb01da
change version to 2.0.4-SNAPSHOT (#8188) 2022-01-25 15:17:17 +08:00
Devosend
7aeac75860
[Feature-7348] [Python] Add workflow as code task type mr (#8140) 2022-01-21 09:54:36 +08:00
Devosend
027af091c7
[Feature-7346] [Python]Add workflow as code task type spark (#7968)
* add spark task

* fix code format

* add parent class for flink and spark

* modify Engine docstring

* modify docstring of Engine
2022-01-15 23:24:55 +08:00
Devosend
891b5663a8
[python] Fix global params bug (#7971) 2022-01-14 10:41:46 +08:00
Jiajie Zhong
65322155a3
[python] Fix database error handler about no datasource name (#7631)
* [python] Fix database error handler about no datasource name

The original code show too many unrelated log when database name
do not exists. BTW, it would continue the code when error miss.
This patch is try to fix it.

close: #7616

* Use java exception instead of self define

* Enhance
2022-01-07 21:29:37 +08:00
Jiajie Zhong
da4a85943c
[python] Add independent deployment for python gateway server (#7549)
* [python] Add independent deployment to python gateway server

* Correct some error

* Add missing deployment change

* Add missing expose port

* Add missing standalone config

* Keyword change from rpc to socket

* try to fix

* Add python gateway server to scp-hosts.sh
2022-01-07 15:16:05 +08:00
Jiajie Zhong
b1edce2b11
[python] Add checker pd attr param and fix switch example (#7818)
* [python] Add checker pd attr param and fix switch example

* Correct submit self.param to java gateway
* Fix missing parameter for switch example
* Add mechanism checker before submit to java gateway

close: #7803

* Fix mock get task code and version

* Change judge statement and add comment
2022-01-05 19:59:20 +08:00
Jiajie Zhong
1417967d9e
[python] Task condition missing two downstream param (#7783)
* [python] Task condition missing two downstream param

We add two downstream tasks to set task condition
success and failed node

close: #7763

* Add getter and setter property condition_resulth in base task
2022-01-05 19:58:44 +08:00
Jiajie Zhong
fcbb5f4d8f
[python] Enhance task datax example (#7801)
* [python] Enhance task datax example

* Add full example for `CustomDataX.json`
* Add comment about datasource need to exists.

close: #7800

* Add missing parameter setting
2022-01-05 19:57:28 +08:00
Jiajie Zhong
f324b2f884
[python] Add test for examples (#7759)
* Make sure all file with `.py` extension and all file
  end with "_example"
* Make sure all examples have `__doc__`
* Make sure not have duplicate process definition name
* Make sure process definition same as filename

close: #7729
2022-01-04 10:09:38 +08:00
Devosend
081adf4aaa
[Feature-7347] [Python]Add workflow as code task type flink (#7632)
* add Flink task for code as flow

Co-authored-by: Jiajie Zhong <zhongjiajie955@gmail.com>
2022-01-04 09:45:54 +08:00
Jiajie Zhong
cc8fbe3e14
[python] Fix task condition set wrong deps (#7650)
After #7505 merged. we could use condition task type
but our dependent set in the wrong direction, all
the condition operators should be upstream of the
current task instead of downstream

fix: #7649
2021-12-27 20:37:40 +08:00
Jiajie Zhong
b1afd99c9e
[python] Fix task relation wrong hashable function (#7628)
* [python] Fix task relation wrong hashable function

Currently our :class:`TaskRelation` have wrong __hash__
function, would mistake a object as same object. It failed
our dependence and process definition. this patch fix it
by adding `_KEY_ATTR` to overwrite TaskRelation's __eq__
and correct __hash__ func

close: #7627

* Fix code format
2021-12-26 15:44:30 +08:00
Jiajie Zhong
fd6eb1f830
[python] Correct python import syntax in example (#7617)
fix: #7615
2021-12-24 20:07:49 +08:00
Jiajie Zhong
946a0c7c57
[python] Add task switch (#7531)
* [python] Add task switch

close: #6928

* Fix code style
2021-12-22 11:46:34 +08:00
Jiajie Zhong
e23a4848c0
[python] Add task condition (#7505)
* [python] Add task condition

close: #6927

* Add example and set downstream dep
2021-12-22 11:06:45 +08:00
Devosend
0c7aa4e2c5
[Feature-7349] [Python]Add workflow as code task type datax (#7437)
* support datax task by python
* add task datax example

Co-authored-by: Jiajie Zhong <zhongjiajie955@gmail.com>
2021-12-17 11:12:48 +08:00
Jiajie Zhong
6f93ebf3ba
[python] Add task dependent (#7405)
fix: #6926
2021-12-16 09:58:50 +08:00
Jiajie Zhong
4988004150
[python] Fix task procedure define error (#7407)
Cause procedure parameter name need `method` instead of `sql`
we change it's name. And remove parameter `sql` from parent
class `Database`

closes: #7386
2021-12-15 10:19:32 +08:00
Jiajie Zhong
1948030151
[python] Add task base database and procedure (#7279)
We add a new task procedure, and add parent class database
for both sql task and procedure task

fix: #6929
2021-12-13 19:54:24 +08:00
kezhenxu94
67cc260d52
Split the components into individual package, refactor configurations to use Spring properties (#7160)
* Split the components into individual package

A follow-up PR will be made to build dedicated Docker images for each
component, so that every component Docker image has minimal jars, which
is easy to maintain and good for security fixes.

* Split the components into individual package

A follow-up PR will be made to build dedicated Docker images for each
component, so that every component Docker image has minimal jars, which
is easy to maintain and good for security fixes.

* Split the components into individual package

A follow-up PR will be made to build dedicated Docker images for each
component, so that every component Docker image has minimal jars, which
is easy to maintain and good for security fixes.
2021-12-10 11:28:53 +08:00
Jiajie Zhong
2a7d6b468f
[python] Refactor get object define communicate to gateway (#7272)
* Change class Base `to_dict` to `get_define` for more clearer
* Remove class TaskParams and sub class make code easy to
  understand and avoid task implement cycle dependence
* Remove class ObjectJsonBase in Task to reduce complexity

fix: #7271
2021-12-08 22:17:13 +08:00
Devosend
f480b8adf8
[Feature-6930] [Python]Add workflow as code task type sub_process (#7022)
* [python] add subProcess task

* refactor python gateway server and task for subprocess

* add function comment for getProcessDefinition

* change process_definition usage of Subprocess task
2021-12-03 10:26:45 +08:00
JinYong Li
5a04b8d49a
update schdule api (#6977) 2021-11-25 10:22:41 +08:00
Jiajie Zhong
d93248acbc
[python] Add custom exception (#6935) 2021-11-23 16:59:38 +08:00
Jiajie Zhong
41e8836c91
[python] Add task sql (#6968)
* [python] Add task sql

* Add java gateway function doc
2021-11-23 16:58:00 +08:00
Jiajie Zhong
6e812be14d
[python] Add ut cover process definitions separate mode (#6908)
* [python] Add ut cover process definitions separate mode

* Remove unused print syntax

* Fix test error, cause raw_script not exists anymore
2021-11-19 17:24:19 +08:00
Jiajie Zhong
0dce68edd7
[python] Add task type python http (#6906)
* [python] Add task type python http

* Fix unittest error

* Fix UT error
2021-11-19 16:37:22 +08:00
JinYong Li
4bec792160
[Fix][Common] rewrite code generate,fix bit shift (#6914)
* rewrite code generate,fix bit shift

* fix ut

* add algorithm from licenses file

* add algorithm from licenses file

* add algorithm from licenses file

* add algorithm from licenses file

* add algorithm from licenses file

* fix ut
2021-11-19 16:04:05 +08:00
Jiajie Zhong
7c5c7ec907
[ci][python] Add isort to sort out import (#6871)
* Add isort config file to fix conflict with black
* Add some doc about isort
2021-11-17 11:48:52 +08:00
Jiajie Zhong
54933b33e3
[ci][python] Add coverage check in CI (#6861)
* [ci] Add coverage check in CI

* Coverage add dependent

* Install pydolphinscheduler before run coverage

* Up test coverage to 87% and down threshold to 85%

* Fix code style

* Add doc about coverage
2021-11-17 09:46:40 +08:00
mask
a998415afe
[Feature][datasource] Change DataSource Connection Pool from Druid to HiKariCP (#6490) (#6828)
* [Feature][datasource] Change DataSource Connection Pool from Druid to HiKariCP (#6490)

* fix pom dep scope

* filter alert

* filter alert

* filter alert

* fix checkstyle

* remove hikaricp version

* update pom

* add properties

* add properties

* rename properties

* fix e2e fail

* rename properties
2021-11-14 13:02:58 +08:00
Jiajie Zhong
e76cf77040
[python] Add parameter schedule for process definition (#6664)
* [python] Add parameter schedule for process definition

* Rebase and fix some code style

* May schedule work on both string and datetime

* Fix flaky test

* Add comment about freeze time

* Add edge test for schedule_json with None schedule

* Fix test function name

* Fix rebase error
2021-11-13 17:21:40 +08:00
Jiajie Zhong
cd8205217a
[python] Fix process definition's user assigned not pass (#6753) 2021-11-13 16:47:08 +08:00
wangxj3
dc8b87e473
[Feature-#6268][server-master] Serial execte process (#6185)
* add serial processInstance

* fix bug

* add test

* fix code style

* fix style code

* add sql

* fix sql error

* add api

* add test

* fix code style

* modify api

* delete column , fix mapper

* fix unimport

* fix test

* fix bug of missing param for Python

* fix code style

* fix test

* fix test

Co-authored-by: wangxj <wangxj31>
2021-11-05 17:25:45 +08:00
Jiajie Zhong
32d4411469
[python] Add flake8 and black for code style and integrated to GA (#6679)
* [python] Add code style lint for GA

* Change github action name

* Auto change by black

* Fix flake8

* Fix broken link for pyds README.md

* Auto fix by black

* Separate GitHub workflows

* Add Black badge and CI locally in README.md
2021-11-05 15:14:28 +08:00
Jiajie Zhong
1165afbdd1
[python] Add param workgroup to process definition (#6667) 2021-11-04 22:25:45 +08:00
Jiajie Zhong
9fb6d6ba9f
Fix f-strings variable error (#6677) 2021-11-04 16:15:16 +08:00
Jiajie Zhong
2e7036529c
Add CI test for python API (#6636)
* Add CI for python API

* Fix task assign without process definition

* Fix ci

* Add header

* Add build badge for pydolphinscheduler

* Add content to README.md

* Remove unnecessary blank line
2021-11-04 11:19:11 +08:00
Jiajie Zhong
9060f8b462
Fix process definitions exists check error (#6668)
* Fix process definitions exists check error

* Add error log while verify status neither success or exists
2021-11-04 10:17:34 +08:00
Jiajie Zhong
ef9de9de3b
Add example about how to bulk create workflow (#6659) 2021-11-03 11:23:09 +08:00
Jiajie Zhong
dd6ed36f65
Add Python API implementation of workflows-as-code (#6269)
* Init DS python SDK pydolphinscheduler: python code definition

* Doc first

* Add quick start and developer doc

* Java documentation change

* Add LICENSE-py4j.txt

* Add py4j to release-docs/LICENSE

* Move dependency version to parent pom

* Remove outdated code

* Add tenant parameter to tutorial
2021-10-31 20:35:46 +08:00