Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-184] Add mark success to CLI #1590

Closed
wants to merge 1 commit into from

Conversation

jgao54
Copy link

@jgao54 jgao54 commented Jun 14, 2016

Dear Airflow Maintainers,

Please accept this PR that addresses the following issues:

Reminders for contributors:

@jgao54 jgao54 changed the title AIRFLOW-184 Add mark success to CLI [AIRFLOW-184] Add mark success to CLI Jun 14, 2016
@criccomini
Copy link
Contributor

Looks like tests are unhappy:

TypeError: mark_success() got an unexpected keyword argument 'confirm_propt'

Typo? :)

Also saw this error, which looks a little more serious:

assert "Wait a minute" in response.data.decode('utf-8')
AssertionError

dag.mark_success(
start_date=args.start_date,
end_date=args.end_date,
confirm_propt=not args.no_confirm,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo? prompt

@bolkedebruin
Copy link
Contributor

I think the overall approach needs to be updated. Ie. you do not mark a "dag" as a success but your mark a "DagRun" and/org its underlying tasksinstances as a success. As such I dont like "dag.mark_success".

Creating TIs outside a dagrun is becoming a big no-no and I would say it is even worse to do so in a "view" component, besides it is indeed not required anymore since #1506 as tasks are eagerly created.

All in all, I really like the functionality but please make it DagRun based.

@criccomini
Copy link
Contributor

Agree with @bolkedebruin's comments about DAG run vs dag.

@@ -3444,7 +3458,7 @@ def find(dag_id=None, run_id=None, execution_date=None,
return dr

@provide_session
def get_task_instances(self, state=None, session=None):
def get_task_instances(self, state=None, to_list=True, session=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is backwards incompatible, and could lead to issues if someone was using unnamed params and providing a session. Worth a quick glance, but I'm OK with this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the only place that I see this used is in jobs.py (twice), and in tests. Would prefer removing the to_list param, and just returning tis. Then updating code that makes the call to use .all() on the return object.

Ack that this is backwards compatible, but seems very limited usage.

@criccomini
Copy link
Contributor

Took another pass and left some comments.

Make sure to take a look at the failing test. Looks like a legit failure after your changes.

Also, we should block on @bolkedebruin for this one, I think, since it's touching DagRun, and he's refactoring stuff there.

@artwr
Copy link
Contributor

artwr commented Jul 12, 2016

Just curious to see if you still intend to refactor this, because I think there is a definite use case for this to be enabled. But maybe this can wait for a REST API.

@jgao54
Copy link
Author

jgao54 commented Jul 13, 2016

@artwr @criccomini @bolkedebruin yeah, definitely still intend to refactor this. The current mark success in the UI has a few bugs, (using mark_success in conjunction with past, upstream, or downstream flag throws the error page in some cases). This pr will address those issues as well. I'm ok with waiting for REST API if it's coming up soon, otherwise I think it may be more beneficial to have this merged (once I clean it up =P ).

@r39132
Copy link
Contributor

r39132 commented Jul 13, 2016

I think a mark success feature is a good one. I have been looking for one and don't like running a backfill to achieve it. There is one issue I noticed on the current 1.7.1.3 release.

I was 3 days behind on an hourly run. I was hoping a single backfill -m would suffice to mark everything success till current. However, since DAG Runs/Task Instances are generated in little groups by scheduler cycles, that was not the case.... I had to continuously run mark success.. for an hour.

@criccomini
Copy link
Contributor

I'm ok with waiting for REST API if it's coming up soon, otherwise I think it may be more beneficial to have this merged (once I clean it up =P ).

I think it's worth getting this PR done. The REST API is likely a long ways away.

@jgao54 jgao54 force-pushed the add_mark_success_to_cli branch 2 times, most recently from ff8b232 to 11873a0 Compare July 18, 2016 06:37
@jgao54
Copy link
Author

jgao54 commented Jul 18, 2016

@bolkedebruin I noticed that subdag's TIs are created independently rather than via DagRun (there are currently no dagrun being created for subdags). Was wondering if this is intentional? imho it would make sense to create dagruns for subdags as well if we want to support mark success / clear a subdag via dagrun.

@bolkedebruin
Copy link
Contributor

@jgao54 that is indeed so, but old style. I have a PR outstanding that does add dag runs to backfills (that is how subdags run) but it needs reviewing/testing

@jgao54
Copy link
Author

jgao54 commented Jul 18, 2016

@bolkedebruin ah I see it! In that case I'll hold off this PR until yours is merged. I will need to make a bit of changes accordingly, but it will be cleaner.

@bolkedebruin
Copy link
Contributor

If you can please review the other pr and +1 it. Thanks!

@criccomini
Copy link
Contributor

@bolkedebruin what's the PR?

@jgao54
Copy link
Author

jgao54 commented Jul 27, 2016

@criccomini #1667

@jgao54
Copy link
Author

jgao54 commented Aug 14, 2016

@criccomini @bolkedebruin @jlowin Updated this PR to reflect the changes from #1667

@jgao54 jgao54 force-pushed the add_mark_success_to_cli branch 4 times, most recently from 317a4e7 to f8eb4b2 Compare August 15, 2016 16:22
@criccomini
Copy link
Contributor

cc @aoen

@criccomini
Copy link
Contributor

Seems like all tests are failing?

@jgao54 jgao54 force-pushed the add_mark_success_to_cli branch 2 times, most recently from 94ffbf0 to 7dbb615 Compare August 16, 2016 03:59
@jgao54
Copy link
Author

jgao54 commented Aug 16, 2016

@criccomini thanks! fixed

@codecov-io
Copy link

codecov-io commented Aug 16, 2016

Current coverage is 64.75% (diff: 79.51%)

Merging #1590 into master will increase coverage by 0.01%

@@             master      #1590   diff @@
==========================================
  Files           127        127          
  Lines          9498       9528    +30   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           6149       6170    +21   
- Misses         3349       3358     +9   
  Partials          0          0          

Powered by Codecov. Last update 821bdb5...7c5199e

@r39132
Copy link
Contributor

r39132 commented Oct 6, 2016

@jgao54 Resurrecting this.. please rebase and prepare for review or request to close.

@r39132
Copy link
Contributor

r39132 commented Oct 11, 2016

@jgao54 Do you still want to merge this? If not, I will close for inactivity.

@asfgit asfgit closed this in 9b689d0 Oct 12, 2016
@r39132
Copy link
Contributor

r39132 commented Oct 12, 2016

@jgao54 closing for inactivity. Please reopen when ready to submit.

alekstorm pushed a commit to alekstorm/incubator-airflow that referenced this pull request Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants