You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Bas Harenslak <ba...@godatadriven.com> on 2019/04/08 12:37:23 UTC
[DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Hi all,
Following Tao Feng’s question to discuss this PR<https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss here if you agree/disagree/would change.
-----------
The summary of the PR:
I was confused by the task context values and suggest to clean up and clarify these variables. Some are derivations from other variables, some are undocumented and unused, some are wrong (name doesn’t match the value). Please discuss what you think of the removal of these variables:
* Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful since these require complex logic to compute the next execution date, however would leave computing the yesterday* and tomorrow* variables up to the user since they are simple one-liners and don't relate to the DAG interval.
* Removed tables. This is a field in params, and is thus also accessible by the user ({{ params.tables }}). Also, it was undocumented.
* Removed latest_date. It's the same as ds and was also undocumented.
* Removed inlets and outlets. Also undocumented, and have the inlets/outlets ever worked/ever been used by anybody?
* Removed end_date and END_DATE. Both have the same value, so it doesn't make sense to have both variables. Also, the value is ds which contains the start date of the interval, so the naming didn't make sense to me. However, if anybody argues in favour of adding "start_date" and "end_date" to provide the start and end datetime of task instance intervals, I'd be happy to add them.
Cheers,
Bas
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by James Meickle <jm...@quantopian.com.INVALID>.
I'm generally in favor of this idea. Several people on my team have been
confused by the different date options and their meaning.
For the dates, I think we should switch to providing alternate
representations of dates exclusively via Jinja filters. So instead of
"next_execution_date", you'd use "execution_date | delta(1)" or whatever.
We have some operators that do this internally and it's generally much
clearer to read.
For inlets/outlets, surely these should be toggled by a config option as to
whether you're using the lineage features, rather than removed wholesale?
They're still in development, so it makes sense they'd be unused; but it
would be annoying to have to patch Airflow to access the variables.
On Mon, Apr 8, 2019 at 8:37 AM Bas Harenslak <ba...@godatadriven.com>
wrote:
> Hi all,
>
> Following Tao Feng’s question to discuss this PR<
> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss here
> if you agree/disagree/would change.
>
> -----------
>
> The summary of the PR:
>
> I was confused by the task context values and suggest to clean up and
> clarify these variables. Some are derivations from other variables, some
> are undocumented and unused, some are wrong (name doesn’t match the value).
> Please discuss what you think of the removal of these variables:
>
>
> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> since these require complex logic to compute the next execution date,
> however would leave computing the yesterday* and tomorrow* variables up to
> the user since they are simple one-liners and don't relate to the DAG
> interval.
> * Removed tables. This is a field in params, and is thus also
> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> * Removed latest_date. It's the same as ds and was also undocumented.
> * Removed inlets and outlets. Also undocumented, and have the
> inlets/outlets ever worked/ever been used by anybody?
> * Removed end_date and END_DATE. Both have the same value, so it
> doesn't make sense to have both variables. Also, the value is ds which
> contains the start date of the interval, so the naming didn't make sense to
> me. However, if anybody argues in favour of adding "start_date" and
> "end_date" to provide the start and end datetime of task instance
> intervals, I'd be happy to add them.
>
> Cheers,
> Bas
>
Re: [DISCUSS] period_start/period_end instead of
execution_date/next_execution_date
Posted by Bas Harenslak <ba...@godatadriven.com>.
From my perspective the confusion is twofold:
1. A DAG run starts at the end of an interval. At first this is confusing to people but after some time it starts to make sense. Some visual change in the UI would be helpful though.
2. execution_date in the TI context - the name is confusing to everybody and should be changed IMO. My suggestion is to leave execution_date as is since many users depend on it, and add two new variables “interval_start” and “interval_end” to denote the start and end of the DAG run interval.
Bas
On 15 Apr 2019, at 15:52, Dan Davydov <dd...@twitter.com.INVALID>> wrote:
You could start a [VOTE][PMC ONLY] thread on this topic (
https://www.apache.org/foundation/voting.html). Not sure if that's the best
Apache way of doing things, but seems fine to me. My PMC vote personally
would maybe be to switch the semantics to the opposite of what they are now
without having an additional config value, but since that's not very
realistic given the migration effort required by users I think a flag would
probably be worth the costs I mentioned in my previous email although it's
definitely a trade-off. Some kinds of new user/existing survey would
probably help collect data to support a decision but could be tough to
conduct.
On Mon, Apr 15, 2019 at 4:34 PM James Meickle
<jm...@quantopian.com.invalid>> wrote:
Personally I would be very interested in working on a flexible schedule
window/window projection patch. But it would be a big undertaking so it
doesn't make sense to start it unless there's a lot of community buy-in to
the idea that we aren't just for day-after ETL systems.
On Mon, Apr 15, 2019 at 8:52 AM airflowuser
<ai...@protonmail.com.invalid>> wrote:
To quote my user-experience professor from ages ago:
"If too many people misuse something you wrote it means that YOU are
doing
something wrong".
Something can be well documented but if it's not intuitive it's likely
that people will get it wrong.
Say someone ask "When did you execute the code?" Your answer will be
direct - the time the code started to run. This is why so many people
misunderstand the execution_date in the terms of Airflow. Airflow took a
word that is well defined in our conscious and replaced it's meaning.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, April 15, 2019 3:35 PM, Dan Davydov
<dd...@twitter.com.INVALID>> wrote:
I think if the mission of Airflow is to be a generic Workflow engine,
the
current semantics of execution date aren't a good default. This might
be
an
unpopular opinion given past threads on this topic :).
The execution_date = end_date semantics make sense for the ETL use case
but
not for other use cases I think Cron syntax is more intuitive to users,
i.e. start_date should match execution_date (although I don't have data
to
back this up). This is especially prevalent in ML, it's almost a rite
of
passage for users to get confused by execution date semantics. I think
a
flag to support different execution date semantics makes sense, even at
the
cost of being a headache to support both and the complexity increase
could
lead to bugs and trickier mailing list support.
On Wed, Apr 10, 2019 at 9:00 PM Gabriel Silk gsilk@dropbox.com.invalid<ma...@dropbox.com.invalid>
wrote:
My two cents:
"execution_date" is definitely confusing to newcomers, and it's
partly
the
ambiguity of the wording, and partly the UI's fault. When I first saw
execution date, I assumed it meant the earliest time at which the
task
will execute, which is wrong. I was confused when no tasks appeared
for3pm until 4pm.
My proposal to fix that:
1. Always show the next task to be executed in the UI, but explain
to
the
user that it's not running because its interval has not yet
completed.
Indicate this state visually, perhaps by using some transparency
or another
color.
2. Instead of just showing execution date in the UI, show the
low/high
range of the time period it covers (for periodic jobs).
As for what we call the low/high timestamps, I like these two
options:
- low_ts, high_ts
- interval_start, interval_end
On Wed, Apr 10, 2019 at 6:43 AM James Meickle
jmeickle@quantopian.com.invalid<ma...@quantopian.com.invalid> wrote:
Strictly tying execution start to interval end doesn't work for
some
workflows (my guess, 1-5% of them?):
- You need to start performing tasks before the interval is over
- You have tasks that reference a single interval, but can't be
completed
until several intervals later (due to data latency)
- The frequency you need to run the task on is different than the
frequency
of the interval you need to process (like processing all
records
from the
last five days, every day)
Airflow doesn't handle any of these situations gracefully and I've
seen
people attempt all sorts of workarounds for them. Probably even
more
people
would try, if we provided decent idioms for doing it rather than
those
workarounds.
On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko
fokko@driesprong.frl<ma...@driesprong.frl>
wrote:
I see what you mean. I don't really like the `period_{start,end}`
name,
but
something such as `interval_{start,end}` might do it for me.
Personally, I think running the job after the interval closes
(since
then
you have all the data over the interval), makes complete sense
for
ETL
jobs. I agree it requires some time to get used to. Maybe we're
lacking
on
documentation here.
Cheers, Fokko
Op wo 10 apr. 2019 om 10:08 schreef Flo Rance
trourance@gmail.com<ma...@gmail.com>:
I didn't expect to participate at any debate on that software,
as
I'm a
complete newcomer. But I'm almost forced as I am the target
audience,
too.
To answer your initial question, after reading a lot of
documentation I
find the term execution_date really counterintuitive, so yes
maybe
period_start and period_end might be a better naming to help to
understand
how all the initial scheduling works. Because even after
reading
the
scheduling section of the doc and the FAQ, it was still not
clear in
my
mind. Btw, I find some ideas exposed by James Meickle in the
[DISCUSS]
AIRFLOW-4192 very interesting and I share his opinion that
there's
still
room for improvement.
But a mode to change from "run at end of period, I need all the
data
available for this period" (the current) to "run at this time
on
the
schedule_interval would be awesome.
Regards,
Flo
On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor
ash@apache.org<ma...@apache.org>
wrote:
Yeah, that's the other thing that has been talked about from
time-to-time,
which is a mode to change from "run at end of period, I need
all
the
data
available for this period" (the current) to "run at this time
on
the
schedule_interval, don't wait for the period to end".
(No such flag exists right now, before you go looking.)
On 9 Apr 2019, at 15:31, Shaw, Damian P. <
damian.shaw.2@credit-suisse.com> wrote:
Hi all,
I'm new to this Airflow Dev mailing list so I wasn't
expecting to
reply
to anything but I feel I am the target audience for this
question.
I
am
quite new to airflow and have been setting up an airflow
environment
for
my
business this last month.
I find the current "execution_date" a small technical
burden
and
a
large
cognitive burden. Our workflow is based on DAGs running at a
specified
time
in a specified timezone using the same date as the current
calendar
date.
I have worked around this by creating my own macro and
context
variables, with the logic looking like this:
airflow_execution_date = context['execution_date']
dag_timezone = context['dag'].timezone
local_execution_date =
dag_timezone.convert(airflow_execution_date)
local_cal_date = local_execution_date +
datetime.timedelta(days=1)
As you can see this isn't a lot of technical effort, but
having a
date
that 1) is in the timezone the business users are working in,
and
2.
Is
the
same calendar date the business users are working in it
significantly
reduces the cognitive effort required to set-up tasks. Of
course
this
doesn't help with cron format scheduling which I just let the
business
give
me the requirements for and I set it up myself as the date
logic
there
is
still confusing as it doesn't work like real cron scheduling
which
everyone
is familiar with.
Maybe "period_start" and "period_end" might help people on
Day 0
of
understanding Airflow get that the dates you are dealing with
are
not
what
you expect, but Day 1+ there's still a lot of cognitive
overhead if
you
don't have the exact same model as AirBnb for running DAGs
and
tasks.
My 2 cents anyway,
Damian Shaw
-----Original Message-----
From: Ash Berlin-Taylor [mailto:ash@apache.org]
Sent: Tuesday, April 09, 2019 10:08 AM
To: dev@airflow.apache.org
Subject: [DISCUSS] period_start/period_end instead of
execution_date/next_execution_date
(trying to break this out in to another thread)
The ML doesn't allow images, but I can guess that it is the
deps
section of a task instance details screen?
I'm not saying it's not clear once you know to look there,
but
I'm
trying remove/reduce the confusion in the first place. And I
think
we
as
committers aren't best placed to know what makes sense as we
have
internalised how Airflow works :)
So I guess this is a question to the newest people on the
list:
Would
`period_start` and `period_end` be more or less confusing for
you
when
you
were first getting started with Airflow?
-ash
On 9 Apr 2019, at 14:47, Driesprong, Fokko
<fokko@driesprong.frl
wrote:
Ash,
Personally, I think this is quite clear, there is a list
of
reasons
why
the job isn't being scheduled:
Coming back to the question of Bas, I believe that
yesterday_ds
does
not make sense since we cannot assume that the schedule is
daily. I
don't
see any usage of this variable. Personally, I do use
next_execution_date
quite extensively. When you have a job that runs daily, but
you
want
to
change this to an hourly job. In such a case you don't want
to
change
{{
(execution_date + macros.timedelta(days=1)) }} to {{
(execution_date
-
macros.timedelta(hours=1)) }} everywhere.
I'm just not sure if the aggressive deprecation of is
really
worth
it.
I don't see too much harm in letting them stay.
Cheers, Fokko
Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
ash@apache.org
mailto:ash@apache.org>:
To (slightly) hijack this thread:
On the subject of execuction_date: as I'm sure we're all
aware
the
concept of execution_date is confusing to new-commers to
Airflow
(there
are
many questions about "why hasn't my DAG run yet"? "Why is my
dag a
day
behind?" etc.) and although we mention this in the docs it's
a
confusing
concept.
What to people think about adding two new parameters:
`period_start`
and `period_end` and making these the preferred terms in
place
of
execution_date and next_execution_date?
This hopefully avoids any ambitious terms like
"execution"
or
"run"
which is understandably easy to conflate with the time the
task is
being
run (i.e. `now()`)
If people think this naming is better and less confusing
I
would
suggest we update all the docs and examples to use these
terms (but
still
mention the old names somewhere, probably in the macros docs)
Thoughts?
-ash
On 8 Apr 2019, at 16:20, Arthur Wiedmer <
arthur.wiedmer@gmail.com
mailto:arthur.wiedmer@gmail.com> wrote:
Hi Bas,
1. I am aware of a few places where those parameters
are used
in
production
in a few hundred jobs. I highly recommend we don't
deprecate
them
unless we
do it in a major version.
2. As James mentioned, inlets and outlets are a
lineage
annotation
feature
which is still under development. Let's leave them in,
but we
can
guard
them behind a feature flag if you prefer.
3. the yesterday*/tomorrow* params are convenience
ones
if you
use
a
daily
ETL. I agree with you that they are simple to compute,
but not
everyone
using Apache Airflow is amazing with Python. Some users
are
only
trying to
get a query scheduled and rely on a couple of niceties
like
these
to
get by.
4. latest_date, end_date (I feel like there used to be
start_date,
but
maybe it got lost) were a blend of things which were
used by a
backfill
framework used internally at Airbnb. Latest date was
used if
you
needed to
join to a dimension for which you only wanted the
latest
version
of
the
attributes in you backfill. end_date was used for time
ranges
where
several
days were processed together in a range to save on
compute. I
don't
see an
issue with removing them.
Best regards,
Arthur
On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
basharenslak@godatadriven.com <mailto:
basharenslak@godatadriven.com
wrote:
Hi all,
Following Tao Feng’s question to discuss this PR<
https://github.com/apache/airflow/pull/5010 <
https://github.com/apache/airflow/pull/5010>>
(AIRFLOW-4192<
https://issues.apache.org/jira/browse/AIRFLOW-4192 <
https://issues.apache.org/jira/browse/AIRFLOW-4192
),
please
discuss
here
if you agree/disagree/would change.
The summary of the PR:
I was confused by the task context values and suggest
to clean
up
and
clarify these variables. Some are derivations from
other
variables,
some
are undocumented and unused, some are wrong (name
doesn’t
match
the
value).
Please discuss what you think of the removal of these
variables:
- Removed yesterday_ds, yesterday_ds_nodash,
tomorrow_ds,
tomorrow_ds_nodash. IMO the next_* and previous_*
variables
are
useful
since these require complex logic to compute the next
execution
date,
however would leave computing the yesterday* and
tomorrow*
variables
up to
the user since they are simple one-liners and don't
relate to
the
DAG
interval.
- Removed tables. This is a field in params, and is
thus
also
accessible by the user ({{ params.tables }}). Also,
it
was
undocumented.
- Removed latest_date. It's the same as ds and was
also
undocumented.
- Removed inlets and outlets. Also undocumented,
and
have
the
inlets/outlets ever worked/ever been used by anybody?
- Removed end_date and END_DATE. Both have the same
value,
so
it
doesn't make sense to have both variables. Also, the
value is
ds
which
contains the start date of the interval, so the
naming
didn't
make
sense to
me. However, if anybody argues in favour of adding
"start_date"
and
"end_date" to provide the start and end datetime of
task
instance
intervals, I'd be happy to add them.
Cheers,
Bas
===============================================================================
Please access the attached hyperlink for an important
electronic
communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by Dan Davydov <dd...@twitter.com.INVALID>.
You could start a [VOTE][PMC ONLY] thread on this topic (
https://www.apache.org/foundation/voting.html). Not sure if that's the best
Apache way of doing things, but seems fine to me. My PMC vote personally
would maybe be to switch the semantics to the opposite of what they are now
without having an additional config value, but since that's not very
realistic given the migration effort required by users I think a flag would
probably be worth the costs I mentioned in my previous email although it's
definitely a trade-off. Some kinds of new user/existing survey would
probably help collect data to support a decision but could be tough to
conduct.
On Mon, Apr 15, 2019 at 4:34 PM James Meickle
<jm...@quantopian.com.invalid> wrote:
> Personally I would be very interested in working on a flexible schedule
> window/window projection patch. But it would be a big undertaking so it
> doesn't make sense to start it unless there's a lot of community buy-in to
> the idea that we aren't just for day-after ETL systems.
>
> On Mon, Apr 15, 2019 at 8:52 AM airflowuser
> <ai...@protonmail.com.invalid> wrote:
>
> > To quote my user-experience professor from ages ago:
> > "If too many people misuse something you wrote it means that YOU are
> doing
> > something wrong".
> >
> > Something can be well documented but if it's not intuitive it's likely
> > that people will get it wrong.
> >
> > Say someone ask "When did you execute the code?" Your answer will be
> > direct - the time the code started to run. This is why so many people
> > misunderstand the execution_date in the terms of Airflow. Airflow took a
> > word that is well defined in our conscious and replaced it's meaning.
> >
> >
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > On Monday, April 15, 2019 3:35 PM, Dan Davydov
> > <dd...@twitter.com.INVALID> wrote:
> >
> > > I think if the mission of Airflow is to be a generic Workflow engine,
> the
> > > current semantics of execution date aren't a good default. This might
> be
> > an
> > > unpopular opinion given past threads on this topic :).
> > >
> > > The execution_date = end_date semantics make sense for the ETL use case
> > but
> > > not for other use cases I think Cron syntax is more intuitive to users,
> > > i.e. start_date should match execution_date (although I don't have data
> > to
> > > back this up). This is especially prevalent in ML, it's almost a rite
> of
> > > passage for users to get confused by execution date semantics. I think
> a
> > > flag to support different execution date semantics makes sense, even at
> > the
> > > cost of being a headache to support both and the complexity increase
> > could
> > > lead to bugs and trickier mailing list support.
> > >
> > > On Wed, Apr 10, 2019 at 9:00 PM Gabriel Silk gsilk@dropbox.com.invalid
> > > wrote:
> > >
> > > > My two cents:
> > > > "execution_date" is definitely confusing to newcomers, and it's
> partly
> > the
> > > > ambiguity of the wording, and partly the UI's fault. When I first saw
> > > > execution date, I assumed it meant the earliest time at which the
> task
> > > > will execute, which is wrong. I was confused when no tasks appeared
> > for3pm until 4pm.
> > > > My proposal to fix that:
> > > >
> > > > 1. Always show the next task to be executed in the UI, but explain
> to
> > the
> > > > user that it's not running because its interval has not yet
> > completed.
> > > > Indicate this state visually, perhaps by using some transparency
> > or another
> > > > color.
> > > >
> > > > 2. Instead of just showing execution date in the UI, show the
> low/high
> > > > range of the time period it covers (for periodic jobs).
> > > >
> > > >
> > > > As for what we call the low/high timestamps, I like these two
> options:
> > > >
> > > > - low_ts, high_ts
> > > > - interval_start, interval_end
> > > >
> > > > On Wed, Apr 10, 2019 at 6:43 AM James Meickle
> > > > jmeickle@quantopian.com.invalid wrote:
> > > >
> > > > > Strictly tying execution start to interval end doesn't work for
> some
> > > > > workflows (my guess, 1-5% of them?):
> > > > >
> > > > > - You need to start performing tasks before the interval is over
> > > > > - You have tasks that reference a single interval, but can't be
> > completed
> > > > > until several intervals later (due to data latency)
> > > > >
> > > > > - The frequency you need to run the task on is different than the
> > > > > frequency
> > > > > of the interval you need to process (like processing all
> records
> > from the
> > > > > last five days, every day)
> > > > >
> > > > >
> > > > > Airflow doesn't handle any of these situations gracefully and I've
> > seen
> > > > > people attempt all sorts of workarounds for them. Probably even
> more
> > > > > people
> > > > > would try, if we provided decent idioms for doing it rather than
> > those
> > > > > workarounds.
> > > > > On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko
> > fokko@driesprong.frl
> > > > > wrote:
> > > > >
> > > > > > I see what you mean. I don't really like the `period_{start,end}`
> > name,
> > > > > > but
> > > > > > something such as `interval_{start,end}` might do it for me.
> > > > > > Personally, I think running the job after the interval closes
> > (since
> > > > > > then
> > > > >
> > > > > > you have all the data over the interval), makes complete sense
> for
> > ETL
> > > > > > jobs. I agree it requires some time to get used to. Maybe we're
> > lacking
> > > > > > on
> > > > > > documentation here.
> > > > > > Cheers, Fokko
> > > > > > Op wo 10 apr. 2019 om 10:08 schreef Flo Rance
> trourance@gmail.com:
> > > > > >
> > > > > > > I didn't expect to participate at any debate on that software,
> as
> > > > > > > I'm a
> > > > >
> > > > > > > complete newcomer. But I'm almost forced as I am the target
> > audience,
> > > > > > > too.
> > > > > > > To answer your initial question, after reading a lot of
> > > > > > > documentation I
> > > > >
> > > > > > > find the term execution_date really counterintuitive, so yes
> > maybe
> > > > > > > period_start and period_end might be a better naming to help to
> > > > > > > understand
> > > > > > > how all the initial scheduling works. Because even after
> reading
> > the
> > > > > > > scheduling section of the doc and the FAQ, it was still not
> > clear in
> > > > > > > my
> > > > >
> > > > > > > mind. Btw, I find some ideas exposed by James Meickle in the
> > > > > > > [DISCUSS]
> > > > >
> > > > > > > AIRFLOW-4192 very interesting and I share his opinion that
> > there's
> > > > > > > still
> > > > > >
> > > > > > > room for improvement.
> > > > > > > But a mode to change from "run at end of period, I need all the
> > data
> > > > > > > available for this period" (the current) to "run at this time
> on
> > > > > > > the
> > > > >
> > > > > > > schedule_interval would be awesome.
> > > > > > > Regards,
> > > > > > > Flo
> > > > > > > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor
> ash@apache.org
> > > > > > > wrote:
> > > > > >
> > > > > > > > Yeah, that's the other thing that has been talked about from
> > > > > > > > time-to-time,
> > > > > > > > which is a mode to change from "run at end of period, I need
> > all
> > > > > > > > the
> > > > >
> > > > > > data
> > > > > >
> > > > > > > > available for this period" (the current) to "run at this time
> > on
> > > > > > > > the
> > > > > >
> > > > > > > > schedule_interval, don't wait for the period to end".
> > > > > > > > (No such flag exists right now, before you go looking.)
> > > > > > > >
> > > > > > > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > > > > > > > damian.shaw.2@credit-suisse.com> wrote:
> > > > > > > > > Hi all,
> > > > > > > > > I'm new to this Airflow Dev mailing list so I wasn't
> > expecting to
> > > > > > > > > reply
> > > > > > >
> > > > > > > > to anything but I feel I am the target audience for this
> > question.
> > > > > > > > I
> > > > > > > > am
> > > > >
> > > > > > > > quite new to airflow and have been setting up an airflow
> > > > > > > > environment
> > > > >
> > > > > > for
> > > > > >
> > > > > > > my
> > > > > > >
> > > > > > > > business this last month.
> > > > > > > >
> > > > > > > > > I find the current "execution_date" a small technical
> burden
> > and
> > > > > > > > > a
> > > > >
> > > > > > > large
> > > > > > >
> > > > > > > > cognitive burden. Our workflow is based on DAGs running at a
> > > > > > > > specified
> > > > > >
> > > > > > > time
> > > > > > >
> > > > > > > > in a specified timezone using the same date as the current
> > calendar
> > > > > > > > date.
> > > > > > >
> > > > > > > > > I have worked around this by creating my own macro and
> > context
> > > > > > > > > variables, with the logic looking like this:
> > > > > > > > > airflow_execution_date = context['execution_date']
> > > > > > > > > dag_timezone = context['dag'].timezone
> > > > > > > > > local_execution_date =
> > > > > > > > > dag_timezone.convert(airflow_execution_date)
> > > > > > > > > local_cal_date = local_execution_date +
> > > > > > > > > datetime.timedelta(days=1)
> > > > > > > >
> > > > > > > > > As you can see this isn't a lot of technical effort, but
> > having a
> > > > > > > > > date
> > > > > > >
> > > > > > > > that 1) is in the timezone the business users are working in,
> > and
> > > >
> > > > 2.
> > > >
> > > > > Is
> > > > >
> > > > > > > the
> > > > > > >
> > > > > > > > same calendar date the business users are working in it
> > > > > > > > significantly
> > > > >
> > > > > > > > reduces the cognitive effort required to set-up tasks. Of
> > course
> > > > > > > > this
> > > > >
> > > > > > > > doesn't help with cron format scheduling which I just let the
> > > > > > > > business
> > > > > >
> > > > > > > give
> > > > > > >
> > > > > > > > me the requirements for and I set it up myself as the date
> > logic
> > > > > > > > there
> > > > > > > > is
> > > > > >
> > > > > > > > still confusing as it doesn't work like real cron scheduling
> > which
> > > > > > > > everyone
> > > > > > > > is familiar with.
> > > > > > > >
> > > > > > > > > Maybe "period_start" and "period_end" might help people on
> > Day 0
> > > > > > > > > of
> > > > >
> > > > > > > > understanding Airflow get that the dates you are dealing with
> > are
> > > > > > > > not
> > > > >
> > > > > > > what
> > > > > > >
> > > > > > > > you expect, but Day 1+ there's still a lot of cognitive
> > overhead if
> > > > > > > > you
> > > > > >
> > > > > > > > don't have the exact same model as AirBnb for running DAGs
> and
> > > > > > > > tasks.
> > > > >
> > > > > > > > > My 2 cents anyway,
> > > > > > > > > Damian Shaw
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > > > > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > > > > > > To: dev@airflow.apache.org
> > > > > > > > > Subject: [DISCUSS] period_start/period_end instead of
> > > > > > > > > execution_date/next_execution_date
> > > > > > > > > (trying to break this out in to another thread)
> > > > > > > > > The ML doesn't allow images, but I can guess that it is the
> > deps
> > > > > > > > > section of a task instance details screen?
> > > > > > > > > I'm not saying it's not clear once you know to look there,
> > but
> > > > > > > > > I'm
> > > > >
> > > > > > > > trying remove/reduce the confusion in the first place. And I
> > think
> > > > > > > > we
> > > > >
> > > > > > as
> > > > > >
> > > > > > > > committers aren't best placed to know what makes sense as we
> > have
> > > > > > > > internalised how Airflow works :)
> > > > > > > >
> > > > > > > > > So I guess this is a question to the newest people on the
> > list:
> > > > > > > > > Would
> > > > > >
> > > > > > > > `period_start` and `period_end` be more or less confusing for
> > you
> > > > > > > > when
> > > > > >
> > > > > > > you
> > > > > > >
> > > > > > > > were first getting started with Airflow?
> > > > > > > >
> > > > > > > > > -ash
> > > > > > > > >
> > > > > > > > > > On 9 Apr 2019, at 14:47, Driesprong, Fokko
> > <fokko@driesprong.frl
> > > > >
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > > Ash,
> > > > > > > > > > Personally, I think this is quite clear, there is a list
> of
> > > > > > > > > > reasons
> > > > > >
> > > > > > > why
> > > > > > >
> > > > > > > > the job isn't being scheduled:
> > > > > > > >
> > > > > > > > > > Coming back to the question of Bas, I believe that
> > yesterday_ds
> > > > > > > > > > does
> > > > > >
> > > > > > > > not make sense since we cannot assume that the schedule is
> > daily. I
> > > > > > > > don't
> > > > > > >
> > > > > > > > see any usage of this variable. Personally, I do use
> > > > > > > > next_execution_date
> > > > > > >
> > > > > > > > quite extensively. When you have a job that runs daily, but
> you
> > > > > > > > want
> > > > > > > > to
> > > > >
> > > > > > > > change this to an hourly job. In such a case you don't want
> to
> > > > > > > > change
> > > > >
> > > > > > {{
> > > > > >
> > > > > > > > (execution_date + macros.timedelta(days=1)) }} to {{
> > > > > > > > (execution_date
> > > > >
> > > > > -
> > > > >
> > > > > > > > macros.timedelta(hours=1)) }} everywhere.
> > > > > > > >
> > > > > > > > > > I'm just not sure if the aggressive deprecation of is
> > really
> > > > > > > > > > worth
> > > > >
> > > > > > it.
> > > > > >
> > > > > > > > I don't see too much harm in letting them stay.
> > > > > > > >
> > > > > > > > > > Cheers, Fokko
> > > > > > > > > > Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> > > > > > > > > > ash@apache.org
> > > > > > >
> > > > > > > > mailto:ash@apache.org>:
> > > > > > > >
> > > > > > > > > > To (slightly) hijack this thread:
> > > > > > > > > > On the subject of execuction_date: as I'm sure we're all
> > aware
> > > > > > > > > > the
> > > > >
> > > > > > > > concept of execution_date is confusing to new-commers to
> > Airflow
> > > > > > > > (there
> > > > > >
> > > > > > > are
> > > > > > >
> > > > > > > > many questions about "why hasn't my DAG run yet"? "Why is my
> > dag a
> > > > > > > > day
> > > > > >
> > > > > > > > behind?" etc.) and although we mention this in the docs it's
> a
> > > > > > > > confusing
> > > > > > >
> > > > > > > > concept.
> > > > > > > >
> > > > > > > > > > What to people think about adding two new parameters:
> > > > > > > > > > `period_start`
> > > > > >
> > > > > > > > and `period_end` and making these the preferred terms in
> place
> > of
> > > > > > > > execution_date and next_execution_date?
> > > > > > > >
> > > > > > > > > > This hopefully avoids any ambitious terms like
> "execution"
> > or
> > > > > > > > > > "run"
> > > > > >
> > > > > > > > which is understandably easy to conflate with the time the
> > task is
> > > > > > > > being
> > > > > > >
> > > > > > > > run (i.e. `now()`)
> > > > > > > >
> > > > > > > > > > If people think this naming is better and less confusing
> I
> > would
> > > > > > > > > > suggest we update all the docs and examples to use these
> > terms (but
> > > > > > > > > > still
> > > > > > >
> > > > > > > > mention the old names somewhere, probably in the macros docs)
> > > > > > > >
> > > > > > > > > > Thoughts?
> > > > > > > > > > -ash
> > > > > > > > > >
> > > > > > > > > > > On 8 Apr 2019, at 16:20, Arthur Wiedmer <
> > > > > > > > > > > arthur.wiedmer@gmail.com
> > > > > >
> > > > > > > > mailto:arthur.wiedmer@gmail.com> wrote:
> > > > > > > >
> > > > > > > > > > > Hi Bas,
> > > > > > > > > > >
> > > > > > > > > > > 1. I am aware of a few places where those parameters
> > are used
> > > > > > > > > > > in
> > > > > > > > > > >
> > > > >
> > > > > > > > production
> > > > > > > >
> > > > > > > > > > > in a few hundred jobs. I highly recommend we don't
> > deprecate
> > > > > > > > > > > them
> > > > >
> > > > > > > > unless we
> > > > > > > >
> > > > > > > > > > > do it in a major version.
> > > > > > > > > > >
> > > > > > > > > > > 2. As James mentioned, inlets and outlets are a
> lineage
> > > > > > > > > > > annotation
> > > > > > > > > > >
> > > > > >
> > > > > > > > feature
> > > > > > > >
> > > > > > > > > > > which is still under development. Let's leave them in,
> > but we
> > > > > > > > > > > can
> > > > >
> > > > > > > guard
> > > > > > >
> > > > > > > > > > > them behind a feature flag if you prefer.
> > > > > > > > > > >
> > > > > > > > > > > 3. the yesterday*/tomorrow* params are convenience
> ones
> > if you
> > > > > > > > > > > use
> > > > > > > > > > > a
> > > > > > > > > > >
> > > > > >
> > > > > > > > daily
> > > > > > > >
> > > > > > > > > > > ETL. I agree with you that they are simple to compute,
> > but not
> > > > > > > > > > > everyone
> > > > > > > >
> > > > > > > > > > > using Apache Airflow is amazing with Python. Some users
> > are
> > > > > > > > > > > only
> > > > >
> > > > > > > > trying to
> > > > > > > >
> > > > > > > > > > > get a query scheduled and rely on a couple of niceties
> > like
> > > > > > > > > > > these
> > > > >
> > > > > > to
> > > > > >
> > > > > > > > get by.
> > > > > > > >
> > > > > > > > > > > 4. latest_date, end_date (I feel like there used to be
> > > > > > > > > > > start_date,
> > > > > > > > > > >
> > > > > >
> > > > > > > but
> > > > > > >
> > > > > > > > > > > maybe it got lost) were a blend of things which were
> > used by a
> > > > > > > > > > > backfill
> > > > > > > >
> > > > > > > > > > > framework used internally at Airbnb. Latest date was
> > used if
> > > > > > > > > > > you
> > > > >
> > > > > > > > needed to
> > > > > > > >
> > > > > > > > > > > join to a dimension for which you only wanted the
> latest
> > > > > > > > > > > version
> > > > > > > > > > > of
> > > > >
> > > > > > > the
> > > > > > >
> > > > > > > > > > > attributes in you backfill. end_date was used for time
> > ranges
> > > > > > > > > > > where
> > > > > >
> > > > > > > > several
> > > > > > > >
> > > > > > > > > > > days were processed together in a range to save on
> > compute. I
> > > > > > > > > > > don't
> > > > > >
> > > > > > > > see an
> > > > > > > >
> > > > > > > > > > > issue with removing them.
> > > > > > > > > > > Best regards,
> > > > > > > > > > > Arthur
> > > > > > > > > > > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > > > > > > > > > basharenslak@godatadriven.com <mailto:
> > > > > > > > > > > basharenslak@godatadriven.com
> > > > >
> > > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > > Hi all,
> > > > > > > > > > > > Following Tao Feng’s question to discuss this PR<
> > > > > > > > > > > > https://github.com/apache/airflow/pull/5010 <
> > > > > > > > > > > > https://github.com/apache/airflow/pull/5010>>
> > (AIRFLOW-4192<
> > > > > > > > >
> > > > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192
> >>),
> > please
> > > > > > > > > > > > discuss
> > > > > >
> > > > > > > here
> > > > > > >
> > > > > > > > > > > > if you agree/disagree/would change.
> > > > > > > > > > > >
> > > > > > > > > > > > The summary of the PR:
> > > > > > > > > > > > I was confused by the task context values and suggest
> > to clean
> > > > > > > > > > > > up
> > > > > >
> > > > > > > and
> > > > > > >
> > > > > > > > > > > > clarify these variables. Some are derivations from
> > other
> > > > > > > > > > > > variables,
> > > > > > >
> > > > > > > > some
> > > > > > > >
> > > > > > > > > > > > are undocumented and unused, some are wrong (name
> > doesn’t
> > > > > > > > > > > > match
> > > > >
> > > > > > the
> > > > > >
> > > > > > > > value).
> > > > > > > >
> > > > > > > > > > > > Please discuss what you think of the removal of these
> > > > > > > > > > > > variables:
> > > > >
> > > > > > > > > > > > - Removed yesterday_ds, yesterday_ds_nodash,
> > tomorrow_ds,
> > > > > > > > > > > > tomorrow_ds_nodash. IMO the next_* and previous_*
> > variables
> > > > > > > > > > > > are
> > > > > > > > > > > >
> > > > >
> > > > > > > useful
> > > > > > >
> > > > > > > > > > > > since these require complex logic to compute the next
> > > > > > > > > > > > execution
> > > > >
> > > > > > > date,
> > > > > > >
> > > > > > > > > > > > however would leave computing the yesterday* and
> > tomorrow*
> > > > > > > > > > > > variables
> > > > > > >
> > > > > > > > up to
> > > > > > > >
> > > > > > > > > > > > the user since they are simple one-liners and don't
> > relate to
> > > > > > > > > > > > the
> > > > > >
> > > > > > > DAG
> > > > > > >
> > > > > > > > > > > > interval.
> > > > > > > > > > > >
> > > > > > > > > > > > - Removed tables. This is a field in params, and is
> > thus
> > > > > > > > > > > > also
> > > > > > > > > > > >
> > > > >
> > > > > > > > > > > > accessible by the user ({{ params.tables }}). Also,
> it
> > was
> > > > > > > > > > > > undocumented.
> > > > > > > > >
> > > > > > > > > > > > - Removed latest_date. It's the same as ds and was
> > also
> > > > > > > > > > > > undocumented.
> > > > > > > > > > > >
> > > > > > > > >
> > > > > > > > > > > > - Removed inlets and outlets. Also undocumented,
> and
> > have
> > > > > > > > > > > > the
> > > > > > > > > > > >
> > > > >
> > > > > > > > > > > > inlets/outlets ever worked/ever been used by anybody?
> > > > > > > > > > > >
> > > > > > > > > > > > - Removed end_date and END_DATE. Both have the same
> > value,
> > > > > > > > > > > > so
> > > > > > > > > > > > it
> > > > > > > > > > > >
> > > > >
> > > > > > > > > > > > doesn't make sense to have both variables. Also, the
> > value is
> > > > > > > > > > > > ds
> > > > >
> > > > > > > which
> > > > > > >
> > > > > > > > > > > > contains the start date of the interval, so the
> naming
> > didn't
> > > > > > > > > > > > make
> > > > > >
> > > > > > > > sense to
> > > > > > > >
> > > > > > > > > > > > me. However, if anybody argues in favour of adding
> > > > > > > > > > > > "start_date"
> > > > >
> > > > > > and
> > > > > >
> > > > > > > > > > > > "end_date" to provide the start and end datetime of
> > task
> > > > > > > > > > > > instance
> > > > > >
> > > > > > > > > > > > intervals, I'd be happy to add them.
> > > > > > > > > > > > Cheers,
> > > > > > > > > > > > Bas
> > > >
> > > >
> >
> ===============================================================================
> > > >
> > > > > > > > > Please access the attached hyperlink for an important
> > electronic
> > > > > > > > > communications disclaimer:
> > > > > > > > >
> > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > > >
> > > >
> >
> ===============================================================================
> > > >
> > > > > > > >
> >
> >
> >
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by James Meickle <jm...@quantopian.com.INVALID>.
Personally I would be very interested in working on a flexible schedule
window/window projection patch. But it would be a big undertaking so it
doesn't make sense to start it unless there's a lot of community buy-in to
the idea that we aren't just for day-after ETL systems.
On Mon, Apr 15, 2019 at 8:52 AM airflowuser
<ai...@protonmail.com.invalid> wrote:
> To quote my user-experience professor from ages ago:
> "If too many people misuse something you wrote it means that YOU are doing
> something wrong".
>
> Something can be well documented but if it's not intuitive it's likely
> that people will get it wrong.
>
> Say someone ask "When did you execute the code?" Your answer will be
> direct - the time the code started to run. This is why so many people
> misunderstand the execution_date in the terms of Airflow. Airflow took a
> word that is well defined in our conscious and replaced it's meaning.
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, April 15, 2019 3:35 PM, Dan Davydov
> <dd...@twitter.com.INVALID> wrote:
>
> > I think if the mission of Airflow is to be a generic Workflow engine, the
> > current semantics of execution date aren't a good default. This might be
> an
> > unpopular opinion given past threads on this topic :).
> >
> > The execution_date = end_date semantics make sense for the ETL use case
> but
> > not for other use cases I think Cron syntax is more intuitive to users,
> > i.e. start_date should match execution_date (although I don't have data
> to
> > back this up). This is especially prevalent in ML, it's almost a rite of
> > passage for users to get confused by execution date semantics. I think a
> > flag to support different execution date semantics makes sense, even at
> the
> > cost of being a headache to support both and the complexity increase
> could
> > lead to bugs and trickier mailing list support.
> >
> > On Wed, Apr 10, 2019 at 9:00 PM Gabriel Silk gsilk@dropbox.com.invalid
> > wrote:
> >
> > > My two cents:
> > > "execution_date" is definitely confusing to newcomers, and it's partly
> the
> > > ambiguity of the wording, and partly the UI's fault. When I first saw
> > > execution date, I assumed it meant the earliest time at which the task
> > > will execute, which is wrong. I was confused when no tasks appeared
> for3pm until 4pm.
> > > My proposal to fix that:
> > >
> > > 1. Always show the next task to be executed in the UI, but explain to
> the
> > > user that it's not running because its interval has not yet
> completed.
> > > Indicate this state visually, perhaps by using some transparency
> or another
> > > color.
> > >
> > > 2. Instead of just showing execution date in the UI, show the low/high
> > > range of the time period it covers (for periodic jobs).
> > >
> > >
> > > As for what we call the low/high timestamps, I like these two options:
> > >
> > > - low_ts, high_ts
> > > - interval_start, interval_end
> > >
> > > On Wed, Apr 10, 2019 at 6:43 AM James Meickle
> > > jmeickle@quantopian.com.invalid wrote:
> > >
> > > > Strictly tying execution start to interval end doesn't work for some
> > > > workflows (my guess, 1-5% of them?):
> > > >
> > > > - You need to start performing tasks before the interval is over
> > > > - You have tasks that reference a single interval, but can't be
> completed
> > > > until several intervals later (due to data latency)
> > > >
> > > > - The frequency you need to run the task on is different than the
> > > > frequency
> > > > of the interval you need to process (like processing all records
> from the
> > > > last five days, every day)
> > > >
> > > >
> > > > Airflow doesn't handle any of these situations gracefully and I've
> seen
> > > > people attempt all sorts of workarounds for them. Probably even more
> > > > people
> > > > would try, if we provided decent idioms for doing it rather than
> those
> > > > workarounds.
> > > > On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko
> fokko@driesprong.frl
> > > > wrote:
> > > >
> > > > > I see what you mean. I don't really like the `period_{start,end}`
> name,
> > > > > but
> > > > > something such as `interval_{start,end}` might do it for me.
> > > > > Personally, I think running the job after the interval closes
> (since
> > > > > then
> > > >
> > > > > you have all the data over the interval), makes complete sense for
> ETL
> > > > > jobs. I agree it requires some time to get used to. Maybe we're
> lacking
> > > > > on
> > > > > documentation here.
> > > > > Cheers, Fokko
> > > > > Op wo 10 apr. 2019 om 10:08 schreef Flo Rance trourance@gmail.com:
> > > > >
> > > > > > I didn't expect to participate at any debate on that software, as
> > > > > > I'm a
> > > >
> > > > > > complete newcomer. But I'm almost forced as I am the target
> audience,
> > > > > > too.
> > > > > > To answer your initial question, after reading a lot of
> > > > > > documentation I
> > > >
> > > > > > find the term execution_date really counterintuitive, so yes
> maybe
> > > > > > period_start and period_end might be a better naming to help to
> > > > > > understand
> > > > > > how all the initial scheduling works. Because even after reading
> the
> > > > > > scheduling section of the doc and the FAQ, it was still not
> clear in
> > > > > > my
> > > >
> > > > > > mind. Btw, I find some ideas exposed by James Meickle in the
> > > > > > [DISCUSS]
> > > >
> > > > > > AIRFLOW-4192 very interesting and I share his opinion that
> there's
> > > > > > still
> > > > >
> > > > > > room for improvement.
> > > > > > But a mode to change from "run at end of period, I need all the
> data
> > > > > > available for this period" (the current) to "run at this time on
> > > > > > the
> > > >
> > > > > > schedule_interval would be awesome.
> > > > > > Regards,
> > > > > > Flo
> > > > > > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor ash@apache.org
> > > > > > wrote:
> > > > >
> > > > > > > Yeah, that's the other thing that has been talked about from
> > > > > > > time-to-time,
> > > > > > > which is a mode to change from "run at end of period, I need
> all
> > > > > > > the
> > > >
> > > > > data
> > > > >
> > > > > > > available for this period" (the current) to "run at this time
> on
> > > > > > > the
> > > > >
> > > > > > > schedule_interval, don't wait for the period to end".
> > > > > > > (No such flag exists right now, before you go looking.)
> > > > > > >
> > > > > > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > > > > > > damian.shaw.2@credit-suisse.com> wrote:
> > > > > > > > Hi all,
> > > > > > > > I'm new to this Airflow Dev mailing list so I wasn't
> expecting to
> > > > > > > > reply
> > > > > >
> > > > > > > to anything but I feel I am the target audience for this
> question.
> > > > > > > I
> > > > > > > am
> > > >
> > > > > > > quite new to airflow and have been setting up an airflow
> > > > > > > environment
> > > >
> > > > > for
> > > > >
> > > > > > my
> > > > > >
> > > > > > > business this last month.
> > > > > > >
> > > > > > > > I find the current "execution_date" a small technical burden
> and
> > > > > > > > a
> > > >
> > > > > > large
> > > > > >
> > > > > > > cognitive burden. Our workflow is based on DAGs running at a
> > > > > > > specified
> > > > >
> > > > > > time
> > > > > >
> > > > > > > in a specified timezone using the same date as the current
> calendar
> > > > > > > date.
> > > > > >
> > > > > > > > I have worked around this by creating my own macro and
> context
> > > > > > > > variables, with the logic looking like this:
> > > > > > > > airflow_execution_date = context['execution_date']
> > > > > > > > dag_timezone = context['dag'].timezone
> > > > > > > > local_execution_date =
> > > > > > > > dag_timezone.convert(airflow_execution_date)
> > > > > > > > local_cal_date = local_execution_date +
> > > > > > > > datetime.timedelta(days=1)
> > > > > > >
> > > > > > > > As you can see this isn't a lot of technical effort, but
> having a
> > > > > > > > date
> > > > > >
> > > > > > > that 1) is in the timezone the business users are working in,
> and
> > >
> > > 2.
> > >
> > > > Is
> > > >
> > > > > > the
> > > > > >
> > > > > > > same calendar date the business users are working in it
> > > > > > > significantly
> > > >
> > > > > > > reduces the cognitive effort required to set-up tasks. Of
> course
> > > > > > > this
> > > >
> > > > > > > doesn't help with cron format scheduling which I just let the
> > > > > > > business
> > > > >
> > > > > > give
> > > > > >
> > > > > > > me the requirements for and I set it up myself as the date
> logic
> > > > > > > there
> > > > > > > is
> > > > >
> > > > > > > still confusing as it doesn't work like real cron scheduling
> which
> > > > > > > everyone
> > > > > > > is familiar with.
> > > > > > >
> > > > > > > > Maybe "period_start" and "period_end" might help people on
> Day 0
> > > > > > > > of
> > > >
> > > > > > > understanding Airflow get that the dates you are dealing with
> are
> > > > > > > not
> > > >
> > > > > > what
> > > > > >
> > > > > > > you expect, but Day 1+ there's still a lot of cognitive
> overhead if
> > > > > > > you
> > > > >
> > > > > > > don't have the exact same model as AirBnb for running DAGs and
> > > > > > > tasks.
> > > >
> > > > > > > > My 2 cents anyway,
> > > > > > > > Damian Shaw
> > > > > > > > -----Original Message-----
> > > > > > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > > > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > > > > > To: dev@airflow.apache.org
> > > > > > > > Subject: [DISCUSS] period_start/period_end instead of
> > > > > > > > execution_date/next_execution_date
> > > > > > > > (trying to break this out in to another thread)
> > > > > > > > The ML doesn't allow images, but I can guess that it is the
> deps
> > > > > > > > section of a task instance details screen?
> > > > > > > > I'm not saying it's not clear once you know to look there,
> but
> > > > > > > > I'm
> > > >
> > > > > > > trying remove/reduce the confusion in the first place. And I
> think
> > > > > > > we
> > > >
> > > > > as
> > > > >
> > > > > > > committers aren't best placed to know what makes sense as we
> have
> > > > > > > internalised how Airflow works :)
> > > > > > >
> > > > > > > > So I guess this is a question to the newest people on the
> list:
> > > > > > > > Would
> > > > >
> > > > > > > `period_start` and `period_end` be more or less confusing for
> you
> > > > > > > when
> > > > >
> > > > > > you
> > > > > >
> > > > > > > were first getting started with Airflow?
> > > > > > >
> > > > > > > > -ash
> > > > > > > >
> > > > > > > > > On 9 Apr 2019, at 14:47, Driesprong, Fokko
> <fokko@driesprong.frl
> > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > > Ash,
> > > > > > > > > Personally, I think this is quite clear, there is a list of
> > > > > > > > > reasons
> > > > >
> > > > > > why
> > > > > >
> > > > > > > the job isn't being scheduled:
> > > > > > >
> > > > > > > > > Coming back to the question of Bas, I believe that
> yesterday_ds
> > > > > > > > > does
> > > > >
> > > > > > > not make sense since we cannot assume that the schedule is
> daily. I
> > > > > > > don't
> > > > > >
> > > > > > > see any usage of this variable. Personally, I do use
> > > > > > > next_execution_date
> > > > > >
> > > > > > > quite extensively. When you have a job that runs daily, but you
> > > > > > > want
> > > > > > > to
> > > >
> > > > > > > change this to an hourly job. In such a case you don't want to
> > > > > > > change
> > > >
> > > > > {{
> > > > >
> > > > > > > (execution_date + macros.timedelta(days=1)) }} to {{
> > > > > > > (execution_date
> > > >
> > > > -
> > > >
> > > > > > > macros.timedelta(hours=1)) }} everywhere.
> > > > > > >
> > > > > > > > > I'm just not sure if the aggressive deprecation of is
> really
> > > > > > > > > worth
> > > >
> > > > > it.
> > > > >
> > > > > > > I don't see too much harm in letting them stay.
> > > > > > >
> > > > > > > > > Cheers, Fokko
> > > > > > > > > Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> > > > > > > > > ash@apache.org
> > > > > >
> > > > > > > mailto:ash@apache.org>:
> > > > > > >
> > > > > > > > > To (slightly) hijack this thread:
> > > > > > > > > On the subject of execuction_date: as I'm sure we're all
> aware
> > > > > > > > > the
> > > >
> > > > > > > concept of execution_date is confusing to new-commers to
> Airflow
> > > > > > > (there
> > > > >
> > > > > > are
> > > > > >
> > > > > > > many questions about "why hasn't my DAG run yet"? "Why is my
> dag a
> > > > > > > day
> > > > >
> > > > > > > behind?" etc.) and although we mention this in the docs it's a
> > > > > > > confusing
> > > > > >
> > > > > > > concept.
> > > > > > >
> > > > > > > > > What to people think about adding two new parameters:
> > > > > > > > > `period_start`
> > > > >
> > > > > > > and `period_end` and making these the preferred terms in place
> of
> > > > > > > execution_date and next_execution_date?
> > > > > > >
> > > > > > > > > This hopefully avoids any ambitious terms like "execution"
> or
> > > > > > > > > "run"
> > > > >
> > > > > > > which is understandably easy to conflate with the time the
> task is
> > > > > > > being
> > > > > >
> > > > > > > run (i.e. `now()`)
> > > > > > >
> > > > > > > > > If people think this naming is better and less confusing I
> would
> > > > > > > > > suggest we update all the docs and examples to use these
> terms (but
> > > > > > > > > still
> > > > > >
> > > > > > > mention the old names somewhere, probably in the macros docs)
> > > > > > >
> > > > > > > > > Thoughts?
> > > > > > > > > -ash
> > > > > > > > >
> > > > > > > > > > On 8 Apr 2019, at 16:20, Arthur Wiedmer <
> > > > > > > > > > arthur.wiedmer@gmail.com
> > > > >
> > > > > > > mailto:arthur.wiedmer@gmail.com> wrote:
> > > > > > >
> > > > > > > > > > Hi Bas,
> > > > > > > > > >
> > > > > > > > > > 1. I am aware of a few places where those parameters
> are used
> > > > > > > > > > in
> > > > > > > > > >
> > > >
> > > > > > > production
> > > > > > >
> > > > > > > > > > in a few hundred jobs. I highly recommend we don't
> deprecate
> > > > > > > > > > them
> > > >
> > > > > > > unless we
> > > > > > >
> > > > > > > > > > do it in a major version.
> > > > > > > > > >
> > > > > > > > > > 2. As James mentioned, inlets and outlets are a lineage
> > > > > > > > > > annotation
> > > > > > > > > >
> > > > >
> > > > > > > feature
> > > > > > >
> > > > > > > > > > which is still under development. Let's leave them in,
> but we
> > > > > > > > > > can
> > > >
> > > > > > guard
> > > > > >
> > > > > > > > > > them behind a feature flag if you prefer.
> > > > > > > > > >
> > > > > > > > > > 3. the yesterday*/tomorrow* params are convenience ones
> if you
> > > > > > > > > > use
> > > > > > > > > > a
> > > > > > > > > >
> > > > >
> > > > > > > daily
> > > > > > >
> > > > > > > > > > ETL. I agree with you that they are simple to compute,
> but not
> > > > > > > > > > everyone
> > > > > > >
> > > > > > > > > > using Apache Airflow is amazing with Python. Some users
> are
> > > > > > > > > > only
> > > >
> > > > > > > trying to
> > > > > > >
> > > > > > > > > > get a query scheduled and rely on a couple of niceties
> like
> > > > > > > > > > these
> > > >
> > > > > to
> > > > >
> > > > > > > get by.
> > > > > > >
> > > > > > > > > > 4. latest_date, end_date (I feel like there used to be
> > > > > > > > > > start_date,
> > > > > > > > > >
> > > > >
> > > > > > but
> > > > > >
> > > > > > > > > > maybe it got lost) were a blend of things which were
> used by a
> > > > > > > > > > backfill
> > > > > > >
> > > > > > > > > > framework used internally at Airbnb. Latest date was
> used if
> > > > > > > > > > you
> > > >
> > > > > > > needed to
> > > > > > >
> > > > > > > > > > join to a dimension for which you only wanted the latest
> > > > > > > > > > version
> > > > > > > > > > of
> > > >
> > > > > > the
> > > > > >
> > > > > > > > > > attributes in you backfill. end_date was used for time
> ranges
> > > > > > > > > > where
> > > > >
> > > > > > > several
> > > > > > >
> > > > > > > > > > days were processed together in a range to save on
> compute. I
> > > > > > > > > > don't
> > > > >
> > > > > > > see an
> > > > > > >
> > > > > > > > > > issue with removing them.
> > > > > > > > > > Best regards,
> > > > > > > > > > Arthur
> > > > > > > > > > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > > > > > > > > basharenslak@godatadriven.com <mailto:
> > > > > > > > > > basharenslak@godatadriven.com
> > > >
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi all,
> > > > > > > > > > > Following Tao Feng’s question to discuss this PR<
> > > > > > > > > > > https://github.com/apache/airflow/pull/5010 <
> > > > > > > > > > > https://github.com/apache/airflow/pull/5010>>
> (AIRFLOW-4192<
> > > > > > > >
> > > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192>>),
> please
> > > > > > > > > > > discuss
> > > > >
> > > > > > here
> > > > > >
> > > > > > > > > > > if you agree/disagree/would change.
> > > > > > > > > > >
> > > > > > > > > > > The summary of the PR:
> > > > > > > > > > > I was confused by the task context values and suggest
> to clean
> > > > > > > > > > > up
> > > > >
> > > > > > and
> > > > > >
> > > > > > > > > > > clarify these variables. Some are derivations from
> other
> > > > > > > > > > > variables,
> > > > > >
> > > > > > > some
> > > > > > >
> > > > > > > > > > > are undocumented and unused, some are wrong (name
> doesn’t
> > > > > > > > > > > match
> > > >
> > > > > the
> > > > >
> > > > > > > value).
> > > > > > >
> > > > > > > > > > > Please discuss what you think of the removal of these
> > > > > > > > > > > variables:
> > > >
> > > > > > > > > > > - Removed yesterday_ds, yesterday_ds_nodash,
> tomorrow_ds,
> > > > > > > > > > > tomorrow_ds_nodash. IMO the next_* and previous_*
> variables
> > > > > > > > > > > are
> > > > > > > > > > >
> > > >
> > > > > > useful
> > > > > >
> > > > > > > > > > > since these require complex logic to compute the next
> > > > > > > > > > > execution
> > > >
> > > > > > date,
> > > > > >
> > > > > > > > > > > however would leave computing the yesterday* and
> tomorrow*
> > > > > > > > > > > variables
> > > > > >
> > > > > > > up to
> > > > > > >
> > > > > > > > > > > the user since they are simple one-liners and don't
> relate to
> > > > > > > > > > > the
> > > > >
> > > > > > DAG
> > > > > >
> > > > > > > > > > > interval.
> > > > > > > > > > >
> > > > > > > > > > > - Removed tables. This is a field in params, and is
> thus
> > > > > > > > > > > also
> > > > > > > > > > >
> > > >
> > > > > > > > > > > accessible by the user ({{ params.tables }}). Also, it
> was
> > > > > > > > > > > undocumented.
> > > > > > > >
> > > > > > > > > > > - Removed latest_date. It's the same as ds and was
> also
> > > > > > > > > > > undocumented.
> > > > > > > > > > >
> > > > > > > >
> > > > > > > > > > > - Removed inlets and outlets. Also undocumented, and
> have
> > > > > > > > > > > the
> > > > > > > > > > >
> > > >
> > > > > > > > > > > inlets/outlets ever worked/ever been used by anybody?
> > > > > > > > > > >
> > > > > > > > > > > - Removed end_date and END_DATE. Both have the same
> value,
> > > > > > > > > > > so
> > > > > > > > > > > it
> > > > > > > > > > >
> > > >
> > > > > > > > > > > doesn't make sense to have both variables. Also, the
> value is
> > > > > > > > > > > ds
> > > >
> > > > > > which
> > > > > >
> > > > > > > > > > > contains the start date of the interval, so the naming
> didn't
> > > > > > > > > > > make
> > > > >
> > > > > > > sense to
> > > > > > >
> > > > > > > > > > > me. However, if anybody argues in favour of adding
> > > > > > > > > > > "start_date"
> > > >
> > > > > and
> > > > >
> > > > > > > > > > > "end_date" to provide the start and end datetime of
> task
> > > > > > > > > > > instance
> > > > >
> > > > > > > > > > > intervals, I'd be happy to add them.
> > > > > > > > > > > Cheers,
> > > > > > > > > > > Bas
> > >
> > >
> ===============================================================================
> > >
> > > > > > > > Please access the attached hyperlink for an important
> electronic
> > > > > > > > communications disclaimer:
> > > > > > > >
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > >
> > >
> ===============================================================================
> > >
> > > > > > >
>
>
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by airflowuser <ai...@protonmail.com.INVALID>.
To quote my user-experience professor from ages ago:
"If too many people misuse something you wrote it means that YOU are doing something wrong".
Something can be well documented but if it's not intuitive it's likely that people will get it wrong.
Say someone ask "When did you execute the code?" Your answer will be direct - the time the code started to run. This is why so many people misunderstand the execution_date in the terms of Airflow. Airflow took a word that is well defined in our conscious and replaced it's meaning.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, April 15, 2019 3:35 PM, Dan Davydov <dd...@twitter.com.INVALID> wrote:
> I think if the mission of Airflow is to be a generic Workflow engine, the
> current semantics of execution date aren't a good default. This might be an
> unpopular opinion given past threads on this topic :).
>
> The execution_date = end_date semantics make sense for the ETL use case but
> not for other use cases I think Cron syntax is more intuitive to users,
> i.e. start_date should match execution_date (although I don't have data to
> back this up). This is especially prevalent in ML, it's almost a rite of
> passage for users to get confused by execution date semantics. I think a
> flag to support different execution date semantics makes sense, even at the
> cost of being a headache to support both and the complexity increase could
> lead to bugs and trickier mailing list support.
>
> On Wed, Apr 10, 2019 at 9:00 PM Gabriel Silk gsilk@dropbox.com.invalid
> wrote:
>
> > My two cents:
> > "execution_date" is definitely confusing to newcomers, and it's partly the
> > ambiguity of the wording, and partly the UI's fault. When I first saw
> > execution date, I assumed it meant the earliest time at which the task
> > will execute, which is wrong. I was confused when no tasks appeared for3pm until 4pm.
> > My proposal to fix that:
> >
> > 1. Always show the next task to be executed in the UI, but explain to the
> > user that it's not running because its interval has not yet completed.
> > Indicate this state visually, perhaps by using some transparency or another
> > color.
> >
> > 2. Instead of just showing execution date in the UI, show the low/high
> > range of the time period it covers (for periodic jobs).
> >
> >
> > As for what we call the low/high timestamps, I like these two options:
> >
> > - low_ts, high_ts
> > - interval_start, interval_end
> >
> > On Wed, Apr 10, 2019 at 6:43 AM James Meickle
> > jmeickle@quantopian.com.invalid wrote:
> >
> > > Strictly tying execution start to interval end doesn't work for some
> > > workflows (my guess, 1-5% of them?):
> > >
> > > - You need to start performing tasks before the interval is over
> > > - You have tasks that reference a single interval, but can't be completed
> > > until several intervals later (due to data latency)
> > >
> > > - The frequency you need to run the task on is different than the
> > > frequency
> > > of the interval you need to process (like processing all records from the
> > > last five days, every day)
> > >
> > >
> > > Airflow doesn't handle any of these situations gracefully and I've seen
> > > people attempt all sorts of workarounds for them. Probably even more
> > > people
> > > would try, if we provided decent idioms for doing it rather than those
> > > workarounds.
> > > On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko fokko@driesprong.frl
> > > wrote:
> > >
> > > > I see what you mean. I don't really like the `period_{start,end}` name,
> > > > but
> > > > something such as `interval_{start,end}` might do it for me.
> > > > Personally, I think running the job after the interval closes (since
> > > > then
> > >
> > > > you have all the data over the interval), makes complete sense for ETL
> > > > jobs. I agree it requires some time to get used to. Maybe we're lacking
> > > > on
> > > > documentation here.
> > > > Cheers, Fokko
> > > > Op wo 10 apr. 2019 om 10:08 schreef Flo Rance trourance@gmail.com:
> > > >
> > > > > I didn't expect to participate at any debate on that software, as
> > > > > I'm a
> > >
> > > > > complete newcomer. But I'm almost forced as I am the target audience,
> > > > > too.
> > > > > To answer your initial question, after reading a lot of
> > > > > documentation I
> > >
> > > > > find the term execution_date really counterintuitive, so yes maybe
> > > > > period_start and period_end might be a better naming to help to
> > > > > understand
> > > > > how all the initial scheduling works. Because even after reading the
> > > > > scheduling section of the doc and the FAQ, it was still not clear in
> > > > > my
> > >
> > > > > mind. Btw, I find some ideas exposed by James Meickle in the
> > > > > [DISCUSS]
> > >
> > > > > AIRFLOW-4192 very interesting and I share his opinion that there's
> > > > > still
> > > >
> > > > > room for improvement.
> > > > > But a mode to change from "run at end of period, I need all the data
> > > > > available for this period" (the current) to "run at this time on
> > > > > the
> > >
> > > > > schedule_interval would be awesome.
> > > > > Regards,
> > > > > Flo
> > > > > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor ash@apache.org
> > > > > wrote:
> > > >
> > > > > > Yeah, that's the other thing that has been talked about from
> > > > > > time-to-time,
> > > > > > which is a mode to change from "run at end of period, I need all
> > > > > > the
> > >
> > > > data
> > > >
> > > > > > available for this period" (the current) to "run at this time on
> > > > > > the
> > > >
> > > > > > schedule_interval, don't wait for the period to end".
> > > > > > (No such flag exists right now, before you go looking.)
> > > > > >
> > > > > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > > > > > damian.shaw.2@credit-suisse.com> wrote:
> > > > > > > Hi all,
> > > > > > > I'm new to this Airflow Dev mailing list so I wasn't expecting to
> > > > > > > reply
> > > > >
> > > > > > to anything but I feel I am the target audience for this question.
> > > > > > I
> > > > > > am
> > >
> > > > > > quite new to airflow and have been setting up an airflow
> > > > > > environment
> > >
> > > > for
> > > >
> > > > > my
> > > > >
> > > > > > business this last month.
> > > > > >
> > > > > > > I find the current "execution_date" a small technical burden and
> > > > > > > a
> > >
> > > > > large
> > > > >
> > > > > > cognitive burden. Our workflow is based on DAGs running at a
> > > > > > specified
> > > >
> > > > > time
> > > > >
> > > > > > in a specified timezone using the same date as the current calendar
> > > > > > date.
> > > > >
> > > > > > > I have worked around this by creating my own macro and context
> > > > > > > variables, with the logic looking like this:
> > > > > > > airflow_execution_date = context['execution_date']
> > > > > > > dag_timezone = context['dag'].timezone
> > > > > > > local_execution_date =
> > > > > > > dag_timezone.convert(airflow_execution_date)
> > > > > > > local_cal_date = local_execution_date +
> > > > > > > datetime.timedelta(days=1)
> > > > > >
> > > > > > > As you can see this isn't a lot of technical effort, but having a
> > > > > > > date
> > > > >
> > > > > > that 1) is in the timezone the business users are working in, and
> >
> > 2.
> >
> > > Is
> > >
> > > > > the
> > > > >
> > > > > > same calendar date the business users are working in it
> > > > > > significantly
> > >
> > > > > > reduces the cognitive effort required to set-up tasks. Of course
> > > > > > this
> > >
> > > > > > doesn't help with cron format scheduling which I just let the
> > > > > > business
> > > >
> > > > > give
> > > > >
> > > > > > me the requirements for and I set it up myself as the date logic
> > > > > > there
> > > > > > is
> > > >
> > > > > > still confusing as it doesn't work like real cron scheduling which
> > > > > > everyone
> > > > > > is familiar with.
> > > > > >
> > > > > > > Maybe "period_start" and "period_end" might help people on Day 0
> > > > > > > of
> > >
> > > > > > understanding Airflow get that the dates you are dealing with are
> > > > > > not
> > >
> > > > > what
> > > > >
> > > > > > you expect, but Day 1+ there's still a lot of cognitive overhead if
> > > > > > you
> > > >
> > > > > > don't have the exact same model as AirBnb for running DAGs and
> > > > > > tasks.
> > >
> > > > > > > My 2 cents anyway,
> > > > > > > Damian Shaw
> > > > > > > -----Original Message-----
> > > > > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > > > > To: dev@airflow.apache.org
> > > > > > > Subject: [DISCUSS] period_start/period_end instead of
> > > > > > > execution_date/next_execution_date
> > > > > > > (trying to break this out in to another thread)
> > > > > > > The ML doesn't allow images, but I can guess that it is the deps
> > > > > > > section of a task instance details screen?
> > > > > > > I'm not saying it's not clear once you know to look there, but
> > > > > > > I'm
> > >
> > > > > > trying remove/reduce the confusion in the first place. And I think
> > > > > > we
> > >
> > > > as
> > > >
> > > > > > committers aren't best placed to know what makes sense as we have
> > > > > > internalised how Airflow works :)
> > > > > >
> > > > > > > So I guess this is a question to the newest people on the list:
> > > > > > > Would
> > > >
> > > > > > `period_start` and `period_end` be more or less confusing for you
> > > > > > when
> > > >
> > > > > you
> > > > >
> > > > > > were first getting started with Airflow?
> > > > > >
> > > > > > > -ash
> > > > > > >
> > > > > > > > On 9 Apr 2019, at 14:47, Driesprong, Fokko <fokko@driesprong.frl
> > >
> > > > > > wrote:
> > > > > >
> > > > > > > > Ash,
> > > > > > > > Personally, I think this is quite clear, there is a list of
> > > > > > > > reasons
> > > >
> > > > > why
> > > > >
> > > > > > the job isn't being scheduled:
> > > > > >
> > > > > > > > Coming back to the question of Bas, I believe that yesterday_ds
> > > > > > > > does
> > > >
> > > > > > not make sense since we cannot assume that the schedule is daily. I
> > > > > > don't
> > > > >
> > > > > > see any usage of this variable. Personally, I do use
> > > > > > next_execution_date
> > > > >
> > > > > > quite extensively. When you have a job that runs daily, but you
> > > > > > want
> > > > > > to
> > >
> > > > > > change this to an hourly job. In such a case you don't want to
> > > > > > change
> > >
> > > > {{
> > > >
> > > > > > (execution_date + macros.timedelta(days=1)) }} to {{
> > > > > > (execution_date
> > >
> > > -
> > >
> > > > > > macros.timedelta(hours=1)) }} everywhere.
> > > > > >
> > > > > > > > I'm just not sure if the aggressive deprecation of is really
> > > > > > > > worth
> > >
> > > > it.
> > > >
> > > > > > I don't see too much harm in letting them stay.
> > > > > >
> > > > > > > > Cheers, Fokko
> > > > > > > > Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> > > > > > > > ash@apache.org
> > > > >
> > > > > > mailto:ash@apache.org>:
> > > > > >
> > > > > > > > To (slightly) hijack this thread:
> > > > > > > > On the subject of execuction_date: as I'm sure we're all aware
> > > > > > > > the
> > >
> > > > > > concept of execution_date is confusing to new-commers to Airflow
> > > > > > (there
> > > >
> > > > > are
> > > > >
> > > > > > many questions about "why hasn't my DAG run yet"? "Why is my dag a
> > > > > > day
> > > >
> > > > > > behind?" etc.) and although we mention this in the docs it's a
> > > > > > confusing
> > > > >
> > > > > > concept.
> > > > > >
> > > > > > > > What to people think about adding two new parameters:
> > > > > > > > `period_start`
> > > >
> > > > > > and `period_end` and making these the preferred terms in place of
> > > > > > execution_date and next_execution_date?
> > > > > >
> > > > > > > > This hopefully avoids any ambitious terms like "execution" or
> > > > > > > > "run"
> > > >
> > > > > > which is understandably easy to conflate with the time the task is
> > > > > > being
> > > > >
> > > > > > run (i.e. `now()`)
> > > > > >
> > > > > > > > If people think this naming is better and less confusing I would
> > > > > > > > suggest we update all the docs and examples to use these terms (but
> > > > > > > > still
> > > > >
> > > > > > mention the old names somewhere, probably in the macros docs)
> > > > > >
> > > > > > > > Thoughts?
> > > > > > > > -ash
> > > > > > > >
> > > > > > > > > On 8 Apr 2019, at 16:20, Arthur Wiedmer <
> > > > > > > > > arthur.wiedmer@gmail.com
> > > >
> > > > > > mailto:arthur.wiedmer@gmail.com> wrote:
> > > > > >
> > > > > > > > > Hi Bas,
> > > > > > > > >
> > > > > > > > > 1. I am aware of a few places where those parameters are used
> > > > > > > > > in
> > > > > > > > >
> > >
> > > > > > production
> > > > > >
> > > > > > > > > in a few hundred jobs. I highly recommend we don't deprecate
> > > > > > > > > them
> > >
> > > > > > unless we
> > > > > >
> > > > > > > > > do it in a major version.
> > > > > > > > >
> > > > > > > > > 2. As James mentioned, inlets and outlets are a lineage
> > > > > > > > > annotation
> > > > > > > > >
> > > >
> > > > > > feature
> > > > > >
> > > > > > > > > which is still under development. Let's leave them in, but we
> > > > > > > > > can
> > >
> > > > > guard
> > > > >
> > > > > > > > > them behind a feature flag if you prefer.
> > > > > > > > >
> > > > > > > > > 3. the yesterday*/tomorrow* params are convenience ones if you
> > > > > > > > > use
> > > > > > > > > a
> > > > > > > > >
> > > >
> > > > > > daily
> > > > > >
> > > > > > > > > ETL. I agree with you that they are simple to compute, but not
> > > > > > > > > everyone
> > > > > >
> > > > > > > > > using Apache Airflow is amazing with Python. Some users are
> > > > > > > > > only
> > >
> > > > > > trying to
> > > > > >
> > > > > > > > > get a query scheduled and rely on a couple of niceties like
> > > > > > > > > these
> > >
> > > > to
> > > >
> > > > > > get by.
> > > > > >
> > > > > > > > > 4. latest_date, end_date (I feel like there used to be
> > > > > > > > > start_date,
> > > > > > > > >
> > > >
> > > > > but
> > > > >
> > > > > > > > > maybe it got lost) were a blend of things which were used by a
> > > > > > > > > backfill
> > > > > >
> > > > > > > > > framework used internally at Airbnb. Latest date was used if
> > > > > > > > > you
> > >
> > > > > > needed to
> > > > > >
> > > > > > > > > join to a dimension for which you only wanted the latest
> > > > > > > > > version
> > > > > > > > > of
> > >
> > > > > the
> > > > >
> > > > > > > > > attributes in you backfill. end_date was used for time ranges
> > > > > > > > > where
> > > >
> > > > > > several
> > > > > >
> > > > > > > > > days were processed together in a range to save on compute. I
> > > > > > > > > don't
> > > >
> > > > > > see an
> > > > > >
> > > > > > > > > issue with removing them.
> > > > > > > > > Best regards,
> > > > > > > > > Arthur
> > > > > > > > > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > > > > > > > basharenslak@godatadriven.com <mailto:
> > > > > > > > > basharenslak@godatadriven.com
> > >
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Hi all,
> > > > > > > > > > Following Tao Feng’s question to discuss this PR<
> > > > > > > > > > https://github.com/apache/airflow/pull/5010 <
> > > > > > > > > > https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> > > > > > >
> > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > > > > > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please
> > > > > > > > > > discuss
> > > >
> > > > > here
> > > > >
> > > > > > > > > > if you agree/disagree/would change.
> > > > > > > > > >
> > > > > > > > > > The summary of the PR:
> > > > > > > > > > I was confused by the task context values and suggest to clean
> > > > > > > > > > up
> > > >
> > > > > and
> > > > >
> > > > > > > > > > clarify these variables. Some are derivations from other
> > > > > > > > > > variables,
> > > > >
> > > > > > some
> > > > > >
> > > > > > > > > > are undocumented and unused, some are wrong (name doesn’t
> > > > > > > > > > match
> > >
> > > > the
> > > >
> > > > > > value).
> > > > > >
> > > > > > > > > > Please discuss what you think of the removal of these
> > > > > > > > > > variables:
> > >
> > > > > > > > > > - Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > > > > > > > > > tomorrow_ds_nodash. IMO the next_* and previous_* variables
> > > > > > > > > > are
> > > > > > > > > >
> > >
> > > > > useful
> > > > >
> > > > > > > > > > since these require complex logic to compute the next
> > > > > > > > > > execution
> > >
> > > > > date,
> > > > >
> > > > > > > > > > however would leave computing the yesterday* and tomorrow*
> > > > > > > > > > variables
> > > > >
> > > > > > up to
> > > > > >
> > > > > > > > > > the user since they are simple one-liners and don't relate to
> > > > > > > > > > the
> > > >
> > > > > DAG
> > > > >
> > > > > > > > > > interval.
> > > > > > > > > >
> > > > > > > > > > - Removed tables. This is a field in params, and is thus
> > > > > > > > > > also
> > > > > > > > > >
> > >
> > > > > > > > > > accessible by the user ({{ params.tables }}). Also, it was
> > > > > > > > > > undocumented.
> > > > > > >
> > > > > > > > > > - Removed latest_date. It's the same as ds and was also
> > > > > > > > > > undocumented.
> > > > > > > > > >
> > > > > > >
> > > > > > > > > > - Removed inlets and outlets. Also undocumented, and have
> > > > > > > > > > the
> > > > > > > > > >
> > >
> > > > > > > > > > inlets/outlets ever worked/ever been used by anybody?
> > > > > > > > > >
> > > > > > > > > > - Removed end_date and END_DATE. Both have the same value,
> > > > > > > > > > so
> > > > > > > > > > it
> > > > > > > > > >
> > >
> > > > > > > > > > doesn't make sense to have both variables. Also, the value is
> > > > > > > > > > ds
> > >
> > > > > which
> > > > >
> > > > > > > > > > contains the start date of the interval, so the naming didn't
> > > > > > > > > > make
> > > >
> > > > > > sense to
> > > > > >
> > > > > > > > > > me. However, if anybody argues in favour of adding
> > > > > > > > > > "start_date"
> > >
> > > > and
> > > >
> > > > > > > > > > "end_date" to provide the start and end datetime of task
> > > > > > > > > > instance
> > > >
> > > > > > > > > > intervals, I'd be happy to add them.
> > > > > > > > > > Cheers,
> > > > > > > > > > Bas
> >
> > ===============================================================================
> >
> > > > > > > Please access the attached hyperlink for an important electronic
> > > > > > > communications disclaimer:
> > > > > > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> > ===============================================================================
> >
> > > > > >
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by Dan Davydov <dd...@twitter.com.INVALID>.
I think if the mission of Airflow is to be a generic Workflow engine, the
current semantics of execution date aren't a good default. This might be an
unpopular opinion given past threads on this topic :).
The execution_date = end_date semantics make sense for the ETL use case but
not for other use cases I think Cron syntax is more intuitive to users,
i.e. start_date should match execution_date (although I don't have data to
back this up). This is especially prevalent in ML, it's almost a rite of
passage for users to get confused by execution date semantics. I think a
flag to support different execution date semantics makes sense, even at the
cost of being a headache to support both and the complexity increase could
lead to bugs and trickier mailing list support.
On Wed, Apr 10, 2019 at 9:00 PM Gabriel Silk <gs...@dropbox.com.invalid>
wrote:
> My two cents:
>
> "execution_date" is definitely confusing to newcomers, and it's partly the
> ambiguity of the wording, and partly the UI's fault. When I first saw
> execution date, I assumed it meant *the earliest time at which the task
> will execute*, which is wrong. I was confused when no tasks appeared for
> 3pm until 4pm.
>
> My proposal to fix that:
> 1) Always show the *next* task to be executed in the UI, but explain to the
> user that it's not running because its interval has not yet completed.
> Indicate this state visually, perhaps by using some transparency or another
> color.
> 2) Instead of just showing execution date in the UI, show the low/high
> range of the time period it covers (for periodic jobs).
>
> As for what we call the low/high timestamps, I like these two options:
> - low_ts, high_ts
> - interval_start, interval_end
>
> On Wed, Apr 10, 2019 at 6:43 AM James Meickle
> <jm...@quantopian.com.invalid> wrote:
>
> > Strictly tying execution start to interval end doesn't work for some
> > workflows (my guess, 1-5% of them?):
> >
> > - You need to start performing tasks before the interval is over
> > - You have tasks that reference a single interval, but can't be completed
> > until several intervals later (due to data latency)
> > - The frequency you need to run the task on is different than the
> frequency
> > of the interval you need to process (like processing all records from the
> > last five days, every day)
> >
> > Airflow doesn't handle any of these situations gracefully and I've seen
> > people attempt all sorts of workarounds for them. Probably even more
> people
> > would try, if we provided decent idioms for doing it rather than those
> > workarounds.
> >
> > On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko <fo...@driesprong.frl>
> > wrote:
> >
> > > I see what you mean. I don't really like the `period_{start,end}` name,
> > but
> > > something such as `interval_{start,end}` might do it for me.
> > >
> > > Personally, I think running the job after the interval closes (since
> then
> > > you have all the data over the interval), makes complete sense for ETL
> > > jobs. I agree it requires some time to get used to. Maybe we're lacking
> > on
> > > documentation here.
> > >
> > > Cheers, Fokko
> > >
> > > Op wo 10 apr. 2019 om 10:08 schreef Flo Rance <tr...@gmail.com>:
> > >
> > > > I didn't expect to participate at any debate on that software, as
> I'm a
> > > > complete newcomer. But I'm almost forced as I am the target audience,
> > > too.
> > > >
> > > > To answer your initial question, after reading a lot of
> documentation I
> > > > find the term execution_date really counterintuitive, so yes maybe
> > > > period_start and period_end might be a better naming to help to
> > > understand
> > > > how all the initial scheduling works. Because even after reading the
> > > > scheduling section of the doc and the FAQ, it was still not clear in
> my
> > > > mind. Btw, I find some ideas exposed by James Meickle in the
> [DISCUSS]
> > > > AIRFLOW-4192 very interesting and I share his opinion that there's
> > still
> > > > room for improvement.
> > > > But a mode to change from "run at end of period, I need all the data
> > > > available for this period" (the current) to "run at _this_ time on
> the
> > > > schedule_interval would be awesome.
> > > >
> > > > Regards,
> > > > Flo
> > > >
> > > > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor <as...@apache.org>
> > wrote:
> > > >
> > > > > Yeah, that's the other thing that has been talked about from
> > > > time-to-time,
> > > > > which is a mode to change from "run at end of period, I need all
> the
> > > data
> > > > > available for this period" (the current) to "run at _this_ time on
> > the
> > > > > schedule_interval, don't wait for the period to end".
> > > > >
> > > > > (No such flag exists right now, before you go looking.)
> > > > >
> > > > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > > > damian.shaw.2@credit-suisse.com> wrote:
> > > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > I'm new to this Airflow Dev mailing list so I wasn't expecting to
> > > reply
> > > > > to anything but I feel I am the target audience for this question.
> I
> > am
> > > > > quite new to airflow and have been setting up an airflow
> environment
> > > for
> > > > my
> > > > > business this last month.
> > > > > >
> > > > > > I find the current "execution_date" a small technical burden and
> a
> > > > large
> > > > > cognitive burden. Our workflow is based on DAGs running at a
> > specified
> > > > time
> > > > > in a specified timezone using the same date as the current calendar
> > > date.
> > > > > >
> > > > > > I have worked around this by creating my own macro and context
> > > > > variables, with the logic looking like this:
> > > > > > airflow_execution_date = context['execution_date']
> > > > > > dag_timezone = context['dag'].timezone
> > > > > > local_execution_date =
> > > > > dag_timezone.convert(airflow_execution_date)
> > > > > > local_cal_date = local_execution_date +
> > > > datetime.timedelta(days=1)
> > > > > >
> > > > > > As you can see this isn't a lot of technical effort, but having a
> > > date
> > > > > that 1) is in the timezone the business users are working in, and
> 2)
> > Is
> > > > the
> > > > > same calendar date the business users are working in it
> significantly
> > > > > reduces the cognitive effort required to set-up tasks. Of course
> this
> > > > > doesn't help with cron format scheduling which I just let the
> > business
> > > > give
> > > > > me the requirements for and I set it up myself as the date logic
> > there
> > > is
> > > > > still confusing as it doesn't work like real cron scheduling which
> > > > everyone
> > > > > is familiar with.
> > > > > >
> > > > > > Maybe "period_start" and "period_end" might help people on Day 0
> of
> > > > > understanding Airflow get that the dates you are dealing with are
> not
> > > > what
> > > > > you expect, but Day 1+ there's still a lot of cognitive overhead if
> > you
> > > > > don't have the exact same model as AirBnb for running DAGs and
> tasks.
> > > > > >
> > > > > > My 2 cents anyway,
> > > > > > Damian Shaw
> > > > > >
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > > > To: dev@airflow.apache.org
> > > > > > Subject: [DISCUSS] period_start/period_end instead of
> > > > > execution_date/next_execution_date
> > > > > >
> > > > > > (trying to break this out in to another thread)
> > > > > >
> > > > > > The ML doesn't allow images, but I can guess that it is the deps
> > > > > section of a task instance details screen?
> > > > > >
> > > > > > I'm not saying it's not clear once you know to look there, but
> I'm
> > > > > trying remove/reduce the confusion in the first place. And I think
> we
> > > as
> > > > > committers aren't best placed to know what makes sense as we have
> > > > > internalised how Airflow works :)
> > > > > >
> > > > > > So I guess this is a question to the newest people on the list:
> > Would
> > > > > `period_start` and `period_end` be more or less confusing for you
> > when
> > > > you
> > > > > were first getting started with Airflow?
> > > > > >
> > > > > > -ash
> > > > > >
> > > > > >> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fokko@driesprong.frl
> >
> > > > > wrote:
> > > > > >>
> > > > > >> Ash,
> > > > > >>
> > > > > >> Personally, I think this is quite clear, there is a list of
> > reasons
> > > > why
> > > > > the job isn't being scheduled:
> > > > > >>
> > > > > >>
> > > > > >> Coming back to the question of Bas, I believe that yesterday_ds
> > does
> > > > > not make sense since we cannot assume that the schedule is daily. I
> > > don't
> > > > > see any usage of this variable. Personally, I do use
> > > next_execution_date
> > > > > quite extensively. When you have a job that runs daily, but you
> want
> > to
> > > > > change this to an hourly job. In such a case you don't want to
> change
> > > {{
> > > > > (execution_date + macros.timedelta(days=1)) }} to {{
> (execution_date
> > +
> > > > > macros.timedelta(hours=1)) }} everywhere.
> > > > > >>
> > > > > >> I'm just not sure if the aggressive deprecation of is really
> worth
> > > it.
> > > > > I don't see too much harm in letting them stay.
> > > > > >>
> > > > > >> Cheers, Fokko
> > > > > >>
> > > > > >> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> > > ash@apache.org
> > > > > <ma...@apache.org>>:
> > > > > >> To (slightly) hijack this thread:
> > > > > >>
> > > > > >> On the subject of execuction_date: as I'm sure we're all aware
> the
> > > > > concept of execution_date is confusing to new-commers to Airflow
> > (there
> > > > are
> > > > > many questions about "why hasn't my DAG run yet"? "Why is my dag a
> > day
> > > > > behind?" etc.) and although we mention this in the docs it's a
> > > confusing
> > > > > concept.
> > > > > >>
> > > > > >> What to people think about adding two new parameters:
> > `period_start`
> > > > > and `period_end` and making these the preferred terms in place of
> > > > > execution_date and next_execution_date?
> > > > > >>
> > > > > >> This hopefully avoids any ambitious terms like "execution" or
> > "run"
> > > > > which is understandably easy to conflate with the time the task is
> > > being
> > > > > run (i.e. `now()`)
> > > > > >>
> > > > > >> If people think this naming is better and less confusing I would
> > > > > suggest we update all the docs and examples to use these terms (but
> > > still
> > > > > mention the old names somewhere, probably in the macros docs)
> > > > > >>
> > > > > >> Thoughts?
> > > > > >>
> > > > > >> -ash
> > > > > >>
> > > > > >>
> > > > > >>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <
> > arthur.wiedmer@gmail.com
> > > > > <ma...@gmail.com>> wrote:
> > > > > >>>
> > > > > >>> Hi Bas,
> > > > > >>>
> > > > > >>> 1) I am aware of a few places where those parameters are used
> in
> > > > > production
> > > > > >>> in a few hundred jobs. I highly recommend we don't deprecate
> them
> > > > > unless we
> > > > > >>> do it in a major version.
> > > > > >>>
> > > > > >>> 2) As James mentioned, inlets and outlets are a lineage
> > annotation
> > > > > feature
> > > > > >>> which is still under development. Let's leave them in, but we
> can
> > > > guard
> > > > > >>> them behind a feature flag if you prefer.
> > > > > >>>
> > > > > >>> 3) the yesterday*/tomorrow* params are convenience ones if you
> > use
> > > a
> > > > > daily
> > > > > >>> ETL. I agree with you that they are simple to compute, but not
> > > > everyone
> > > > > >>> using Apache Airflow is amazing with Python. Some users are
> only
> > > > > trying to
> > > > > >>> get a query scheduled and rely on a couple of niceties like
> these
> > > to
> > > > > get by.
> > > > > >>>
> > > > > >>> 4) latest_date, end_date (I feel like there used to be
> > start_date,
> > > > but
> > > > > >>> maybe it got lost) were a blend of things which were used by a
> > > > backfill
> > > > > >>> framework used internally at Airbnb. Latest date was used if
> you
> > > > > needed to
> > > > > >>> join to a dimension for which you only wanted the latest
> version
> > of
> > > > the
> > > > > >>> attributes in you backfill. end_date was used for time ranges
> > where
> > > > > several
> > > > > >>> days were processed together in a range to save on compute. I
> > don't
> > > > > see an
> > > > > >>> issue with removing them.
> > > > > >>>
> > > > > >>> Best regards,
> > > > > >>> Arthur
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > > > basharenslak@godatadriven.com <mailto:
> basharenslak@godatadriven.com
> > >>
> > > > > >>> wrote:
> > > > > >>>
> > > > > >>>> Hi all,
> > > > > >>>>
> > > > > >>>> Following Tao Feng’s question to discuss this PR<
> > > > > >>>> https://github.com/apache/airflow/pull/5010 <
> > > > > https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> > > > > >>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > > > https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please
> > discuss
> > > > here
> > > > > >>>> if you agree/disagree/would change.
> > > > > >>>>
> > > > > >>>> -----------
> > > > > >>>>
> > > > > >>>> The summary of the PR:
> > > > > >>>>
> > > > > >>>> I was confused by the task context values and suggest to clean
> > up
> > > > and
> > > > > >>>> clarify these variables. Some are derivations from other
> > > variables,
> > > > > some
> > > > > >>>> are undocumented and unused, some are wrong (name doesn’t
> match
> > > the
> > > > > value).
> > > > > >>>> Please discuss what you think of the removal of these
> variables:
> > > > > >>>>
> > > > > >>>>
> > > > > >>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > > > > >>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables
> are
> > > > useful
> > > > > >>>> since these require complex logic to compute the next
> execution
> > > > date,
> > > > > >>>> however would leave computing the yesterday* and tomorrow*
> > > variables
> > > > > up to
> > > > > >>>> the user since they are simple one-liners and don't relate to
> > the
> > > > DAG
> > > > > >>>> interval.
> > > > > >>>> * Removed tables. This is a field in params, and is thus
> also
> > > > > >>>> accessible by the user ({{ params.tables }}). Also, it was
> > > > > undocumented.
> > > > > >>>> * Removed latest_date. It's the same as ds and was also
> > > > > undocumented.
> > > > > >>>> * Removed inlets and outlets. Also undocumented, and have
> the
> > > > > >>>> inlets/outlets ever worked/ever been used by anybody?
> > > > > >>>> * Removed end_date and END_DATE. Both have the same value,
> so
> > it
> > > > > >>>> doesn't make sense to have both variables. Also, the value is
> ds
> > > > which
> > > > > >>>> contains the start date of the interval, so the naming didn't
> > make
> > > > > sense to
> > > > > >>>> me. However, if anybody argues in favour of adding
> "start_date"
> > > and
> > > > > >>>> "end_date" to provide the start and end datetime of task
> > instance
> > > > > >>>> intervals, I'd be happy to add them.
> > > > > >>>>
> > > > > >>>> Cheers,
> > > > > >>>> Bas
> > > > > >>>>
> > > > > >>
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> ===============================================================================
> > > > >
> > > > > > Please access the attached hyperlink for an important electronic
> > > > > communications disclaimer:
> > > > > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > > > > >
> > > > >
> > > >
> > >
> >
> ===============================================================================
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by Gabriel Silk <gs...@dropbox.com.INVALID>.
My two cents:
"execution_date" is definitely confusing to newcomers, and it's partly the
ambiguity of the wording, and partly the UI's fault. When I first saw
execution date, I assumed it meant *the earliest time at which the task
will execute*, which is wrong. I was confused when no tasks appeared for
3pm until 4pm.
My proposal to fix that:
1) Always show the *next* task to be executed in the UI, but explain to the
user that it's not running because its interval has not yet completed.
Indicate this state visually, perhaps by using some transparency or another
color.
2) Instead of just showing execution date in the UI, show the low/high
range of the time period it covers (for periodic jobs).
As for what we call the low/high timestamps, I like these two options:
- low_ts, high_ts
- interval_start, interval_end
On Wed, Apr 10, 2019 at 6:43 AM James Meickle
<jm...@quantopian.com.invalid> wrote:
> Strictly tying execution start to interval end doesn't work for some
> workflows (my guess, 1-5% of them?):
>
> - You need to start performing tasks before the interval is over
> - You have tasks that reference a single interval, but can't be completed
> until several intervals later (due to data latency)
> - The frequency you need to run the task on is different than the frequency
> of the interval you need to process (like processing all records from the
> last five days, every day)
>
> Airflow doesn't handle any of these situations gracefully and I've seen
> people attempt all sorts of workarounds for them. Probably even more people
> would try, if we provided decent idioms for doing it rather than those
> workarounds.
>
> On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko <fo...@driesprong.frl>
> wrote:
>
> > I see what you mean. I don't really like the `period_{start,end}` name,
> but
> > something such as `interval_{start,end}` might do it for me.
> >
> > Personally, I think running the job after the interval closes (since then
> > you have all the data over the interval), makes complete sense for ETL
> > jobs. I agree it requires some time to get used to. Maybe we're lacking
> on
> > documentation here.
> >
> > Cheers, Fokko
> >
> > Op wo 10 apr. 2019 om 10:08 schreef Flo Rance <tr...@gmail.com>:
> >
> > > I didn't expect to participate at any debate on that software, as I'm a
> > > complete newcomer. But I'm almost forced as I am the target audience,
> > too.
> > >
> > > To answer your initial question, after reading a lot of documentation I
> > > find the term execution_date really counterintuitive, so yes maybe
> > > period_start and period_end might be a better naming to help to
> > understand
> > > how all the initial scheduling works. Because even after reading the
> > > scheduling section of the doc and the FAQ, it was still not clear in my
> > > mind. Btw, I find some ideas exposed by James Meickle in the [DISCUSS]
> > > AIRFLOW-4192 very interesting and I share his opinion that there's
> still
> > > room for improvement.
> > > But a mode to change from "run at end of period, I need all the data
> > > available for this period" (the current) to "run at _this_ time on the
> > > schedule_interval would be awesome.
> > >
> > > Regards,
> > > Flo
> > >
> > > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor <as...@apache.org>
> wrote:
> > >
> > > > Yeah, that's the other thing that has been talked about from
> > > time-to-time,
> > > > which is a mode to change from "run at end of period, I need all the
> > data
> > > > available for this period" (the current) to "run at _this_ time on
> the
> > > > schedule_interval, don't wait for the period to end".
> > > >
> > > > (No such flag exists right now, before you go looking.)
> > > >
> > > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > > damian.shaw.2@credit-suisse.com> wrote:
> > > > >
> > > > > Hi all,
> > > > >
> > > > > I'm new to this Airflow Dev mailing list so I wasn't expecting to
> > reply
> > > > to anything but I feel I am the target audience for this question. I
> am
> > > > quite new to airflow and have been setting up an airflow environment
> > for
> > > my
> > > > business this last month.
> > > > >
> > > > > I find the current "execution_date" a small technical burden and a
> > > large
> > > > cognitive burden. Our workflow is based on DAGs running at a
> specified
> > > time
> > > > in a specified timezone using the same date as the current calendar
> > date.
> > > > >
> > > > > I have worked around this by creating my own macro and context
> > > > variables, with the logic looking like this:
> > > > > airflow_execution_date = context['execution_date']
> > > > > dag_timezone = context['dag'].timezone
> > > > > local_execution_date =
> > > > dag_timezone.convert(airflow_execution_date)
> > > > > local_cal_date = local_execution_date +
> > > datetime.timedelta(days=1)
> > > > >
> > > > > As you can see this isn't a lot of technical effort, but having a
> > date
> > > > that 1) is in the timezone the business users are working in, and 2)
> Is
> > > the
> > > > same calendar date the business users are working in it significantly
> > > > reduces the cognitive effort required to set-up tasks. Of course this
> > > > doesn't help with cron format scheduling which I just let the
> business
> > > give
> > > > me the requirements for and I set it up myself as the date logic
> there
> > is
> > > > still confusing as it doesn't work like real cron scheduling which
> > > everyone
> > > > is familiar with.
> > > > >
> > > > > Maybe "period_start" and "period_end" might help people on Day 0 of
> > > > understanding Airflow get that the dates you are dealing with are not
> > > what
> > > > you expect, but Day 1+ there's still a lot of cognitive overhead if
> you
> > > > don't have the exact same model as AirBnb for running DAGs and tasks.
> > > > >
> > > > > My 2 cents anyway,
> > > > > Damian Shaw
> > > > >
> > > > >
> > > > > -----Original Message-----
> > > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > > To: dev@airflow.apache.org
> > > > > Subject: [DISCUSS] period_start/period_end instead of
> > > > execution_date/next_execution_date
> > > > >
> > > > > (trying to break this out in to another thread)
> > > > >
> > > > > The ML doesn't allow images, but I can guess that it is the deps
> > > > section of a task instance details screen?
> > > > >
> > > > > I'm not saying it's not clear once you know to look there, but I'm
> > > > trying remove/reduce the confusion in the first place. And I think we
> > as
> > > > committers aren't best placed to know what makes sense as we have
> > > > internalised how Airflow works :)
> > > > >
> > > > > So I guess this is a question to the newest people on the list:
> Would
> > > > `period_start` and `period_end` be more or less confusing for you
> when
> > > you
> > > > were first getting started with Airflow?
> > > > >
> > > > > -ash
> > > > >
> > > > >> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl>
> > > > wrote:
> > > > >>
> > > > >> Ash,
> > > > >>
> > > > >> Personally, I think this is quite clear, there is a list of
> reasons
> > > why
> > > > the job isn't being scheduled:
> > > > >>
> > > > >>
> > > > >> Coming back to the question of Bas, I believe that yesterday_ds
> does
> > > > not make sense since we cannot assume that the schedule is daily. I
> > don't
> > > > see any usage of this variable. Personally, I do use
> > next_execution_date
> > > > quite extensively. When you have a job that runs daily, but you want
> to
> > > > change this to an hourly job. In such a case you don't want to change
> > {{
> > > > (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date
> +
> > > > macros.timedelta(hours=1)) }} everywhere.
> > > > >>
> > > > >> I'm just not sure if the aggressive deprecation of is really worth
> > it.
> > > > I don't see too much harm in letting them stay.
> > > > >>
> > > > >> Cheers, Fokko
> > > > >>
> > > > >> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> > ash@apache.org
> > > > <ma...@apache.org>>:
> > > > >> To (slightly) hijack this thread:
> > > > >>
> > > > >> On the subject of execuction_date: as I'm sure we're all aware the
> > > > concept of execution_date is confusing to new-commers to Airflow
> (there
> > > are
> > > > many questions about "why hasn't my DAG run yet"? "Why is my dag a
> day
> > > > behind?" etc.) and although we mention this in the docs it's a
> > confusing
> > > > concept.
> > > > >>
> > > > >> What to people think about adding two new parameters:
> `period_start`
> > > > and `period_end` and making these the preferred terms in place of
> > > > execution_date and next_execution_date?
> > > > >>
> > > > >> This hopefully avoids any ambitious terms like "execution" or
> "run"
> > > > which is understandably easy to conflate with the time the task is
> > being
> > > > run (i.e. `now()`)
> > > > >>
> > > > >> If people think this naming is better and less confusing I would
> > > > suggest we update all the docs and examples to use these terms (but
> > still
> > > > mention the old names somewhere, probably in the macros docs)
> > > > >>
> > > > >> Thoughts?
> > > > >>
> > > > >> -ash
> > > > >>
> > > > >>
> > > > >>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <
> arthur.wiedmer@gmail.com
> > > > <ma...@gmail.com>> wrote:
> > > > >>>
> > > > >>> Hi Bas,
> > > > >>>
> > > > >>> 1) I am aware of a few places where those parameters are used in
> > > > production
> > > > >>> in a few hundred jobs. I highly recommend we don't deprecate them
> > > > unless we
> > > > >>> do it in a major version.
> > > > >>>
> > > > >>> 2) As James mentioned, inlets and outlets are a lineage
> annotation
> > > > feature
> > > > >>> which is still under development. Let's leave them in, but we can
> > > guard
> > > > >>> them behind a feature flag if you prefer.
> > > > >>>
> > > > >>> 3) the yesterday*/tomorrow* params are convenience ones if you
> use
> > a
> > > > daily
> > > > >>> ETL. I agree with you that they are simple to compute, but not
> > > everyone
> > > > >>> using Apache Airflow is amazing with Python. Some users are only
> > > > trying to
> > > > >>> get a query scheduled and rely on a couple of niceties like these
> > to
> > > > get by.
> > > > >>>
> > > > >>> 4) latest_date, end_date (I feel like there used to be
> start_date,
> > > but
> > > > >>> maybe it got lost) were a blend of things which were used by a
> > > backfill
> > > > >>> framework used internally at Airbnb. Latest date was used if you
> > > > needed to
> > > > >>> join to a dimension for which you only wanted the latest version
> of
> > > the
> > > > >>> attributes in you backfill. end_date was used for time ranges
> where
> > > > several
> > > > >>> days were processed together in a range to save on compute. I
> don't
> > > > see an
> > > > >>> issue with removing them.
> > > > >>>
> > > > >>> Best regards,
> > > > >>> Arthur
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > > basharenslak@godatadriven.com <mailto:basharenslak@godatadriven.com
> >>
> > > > >>> wrote:
> > > > >>>
> > > > >>>> Hi all,
> > > > >>>>
> > > > >>>> Following Tao Feng’s question to discuss this PR<
> > > > >>>> https://github.com/apache/airflow/pull/5010 <
> > > > https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> > > > >>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > > https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please
> discuss
> > > here
> > > > >>>> if you agree/disagree/would change.
> > > > >>>>
> > > > >>>> -----------
> > > > >>>>
> > > > >>>> The summary of the PR:
> > > > >>>>
> > > > >>>> I was confused by the task context values and suggest to clean
> up
> > > and
> > > > >>>> clarify these variables. Some are derivations from other
> > variables,
> > > > some
> > > > >>>> are undocumented and unused, some are wrong (name doesn’t match
> > the
> > > > value).
> > > > >>>> Please discuss what you think of the removal of these variables:
> > > > >>>>
> > > > >>>>
> > > > >>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > > > >>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> > > useful
> > > > >>>> since these require complex logic to compute the next execution
> > > date,
> > > > >>>> however would leave computing the yesterday* and tomorrow*
> > variables
> > > > up to
> > > > >>>> the user since they are simple one-liners and don't relate to
> the
> > > DAG
> > > > >>>> interval.
> > > > >>>> * Removed tables. This is a field in params, and is thus also
> > > > >>>> accessible by the user ({{ params.tables }}). Also, it was
> > > > undocumented.
> > > > >>>> * Removed latest_date. It's the same as ds and was also
> > > > undocumented.
> > > > >>>> * Removed inlets and outlets. Also undocumented, and have the
> > > > >>>> inlets/outlets ever worked/ever been used by anybody?
> > > > >>>> * Removed end_date and END_DATE. Both have the same value, so
> it
> > > > >>>> doesn't make sense to have both variables. Also, the value is ds
> > > which
> > > > >>>> contains the start date of the interval, so the naming didn't
> make
> > > > sense to
> > > > >>>> me. However, if anybody argues in favour of adding "start_date"
> > and
> > > > >>>> "end_date" to provide the start and end datetime of task
> instance
> > > > >>>> intervals, I'd be happy to add them.
> > > > >>>>
> > > > >>>> Cheers,
> > > > >>>> Bas
> > > > >>>>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> ===============================================================================
> > > >
> > > > > Please access the attached hyperlink for an important electronic
> > > > communications disclaimer:
> > > > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > > > >
> > > >
> > >
> >
> ===============================================================================
> > > >
> > > >
> > > >
> > >
> >
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by James Meickle <jm...@quantopian.com.INVALID>.
Strictly tying execution start to interval end doesn't work for some
workflows (my guess, 1-5% of them?):
- You need to start performing tasks before the interval is over
- You have tasks that reference a single interval, but can't be completed
until several intervals later (due to data latency)
- The frequency you need to run the task on is different than the frequency
of the interval you need to process (like processing all records from the
last five days, every day)
Airflow doesn't handle any of these situations gracefully and I've seen
people attempt all sorts of workarounds for them. Probably even more people
would try, if we provided decent idioms for doing it rather than those
workarounds.
On Wed, Apr 10, 2019 at 9:30 AM Driesprong, Fokko <fo...@driesprong.frl>
wrote:
> I see what you mean. I don't really like the `period_{start,end}` name, but
> something such as `interval_{start,end}` might do it for me.
>
> Personally, I think running the job after the interval closes (since then
> you have all the data over the interval), makes complete sense for ETL
> jobs. I agree it requires some time to get used to. Maybe we're lacking on
> documentation here.
>
> Cheers, Fokko
>
> Op wo 10 apr. 2019 om 10:08 schreef Flo Rance <tr...@gmail.com>:
>
> > I didn't expect to participate at any debate on that software, as I'm a
> > complete newcomer. But I'm almost forced as I am the target audience,
> too.
> >
> > To answer your initial question, after reading a lot of documentation I
> > find the term execution_date really counterintuitive, so yes maybe
> > period_start and period_end might be a better naming to help to
> understand
> > how all the initial scheduling works. Because even after reading the
> > scheduling section of the doc and the FAQ, it was still not clear in my
> > mind. Btw, I find some ideas exposed by James Meickle in the [DISCUSS]
> > AIRFLOW-4192 very interesting and I share his opinion that there's still
> > room for improvement.
> > But a mode to change from "run at end of period, I need all the data
> > available for this period" (the current) to "run at _this_ time on the
> > schedule_interval would be awesome.
> >
> > Regards,
> > Flo
> >
> > On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor <as...@apache.org> wrote:
> >
> > > Yeah, that's the other thing that has been talked about from
> > time-to-time,
> > > which is a mode to change from "run at end of period, I need all the
> data
> > > available for this period" (the current) to "run at _this_ time on the
> > > schedule_interval, don't wait for the period to end".
> > >
> > > (No such flag exists right now, before you go looking.)
> > >
> > > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > > damian.shaw.2@credit-suisse.com> wrote:
> > > >
> > > > Hi all,
> > > >
> > > > I'm new to this Airflow Dev mailing list so I wasn't expecting to
> reply
> > > to anything but I feel I am the target audience for this question. I am
> > > quite new to airflow and have been setting up an airflow environment
> for
> > my
> > > business this last month.
> > > >
> > > > I find the current "execution_date" a small technical burden and a
> > large
> > > cognitive burden. Our workflow is based on DAGs running at a specified
> > time
> > > in a specified timezone using the same date as the current calendar
> date.
> > > >
> > > > I have worked around this by creating my own macro and context
> > > variables, with the logic looking like this:
> > > > airflow_execution_date = context['execution_date']
> > > > dag_timezone = context['dag'].timezone
> > > > local_execution_date =
> > > dag_timezone.convert(airflow_execution_date)
> > > > local_cal_date = local_execution_date +
> > datetime.timedelta(days=1)
> > > >
> > > > As you can see this isn't a lot of technical effort, but having a
> date
> > > that 1) is in the timezone the business users are working in, and 2) Is
> > the
> > > same calendar date the business users are working in it significantly
> > > reduces the cognitive effort required to set-up tasks. Of course this
> > > doesn't help with cron format scheduling which I just let the business
> > give
> > > me the requirements for and I set it up myself as the date logic there
> is
> > > still confusing as it doesn't work like real cron scheduling which
> > everyone
> > > is familiar with.
> > > >
> > > > Maybe "period_start" and "period_end" might help people on Day 0 of
> > > understanding Airflow get that the dates you are dealing with are not
> > what
> > > you expect, but Day 1+ there's still a lot of cognitive overhead if you
> > > don't have the exact same model as AirBnb for running DAGs and tasks.
> > > >
> > > > My 2 cents anyway,
> > > > Damian Shaw
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > > To: dev@airflow.apache.org
> > > > Subject: [DISCUSS] period_start/period_end instead of
> > > execution_date/next_execution_date
> > > >
> > > > (trying to break this out in to another thread)
> > > >
> > > > The ML doesn't allow images, but I can guess that it is the deps
> > > section of a task instance details screen?
> > > >
> > > > I'm not saying it's not clear once you know to look there, but I'm
> > > trying remove/reduce the confusion in the first place. And I think we
> as
> > > committers aren't best placed to know what makes sense as we have
> > > internalised how Airflow works :)
> > > >
> > > > So I guess this is a question to the newest people on the list: Would
> > > `period_start` and `period_end` be more or less confusing for you when
> > you
> > > were first getting started with Airflow?
> > > >
> > > > -ash
> > > >
> > > >> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl>
> > > wrote:
> > > >>
> > > >> Ash,
> > > >>
> > > >> Personally, I think this is quite clear, there is a list of reasons
> > why
> > > the job isn't being scheduled:
> > > >>
> > > >>
> > > >> Coming back to the question of Bas, I believe that yesterday_ds does
> > > not make sense since we cannot assume that the schedule is daily. I
> don't
> > > see any usage of this variable. Personally, I do use
> next_execution_date
> > > quite extensively. When you have a job that runs daily, but you want to
> > > change this to an hourly job. In such a case you don't want to change
> {{
> > > (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date +
> > > macros.timedelta(hours=1)) }} everywhere.
> > > >>
> > > >> I'm just not sure if the aggressive deprecation of is really worth
> it.
> > > I don't see too much harm in letting them stay.
> > > >>
> > > >> Cheers, Fokko
> > > >>
> > > >> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <
> ash@apache.org
> > > <ma...@apache.org>>:
> > > >> To (slightly) hijack this thread:
> > > >>
> > > >> On the subject of execuction_date: as I'm sure we're all aware the
> > > concept of execution_date is confusing to new-commers to Airflow (there
> > are
> > > many questions about "why hasn't my DAG run yet"? "Why is my dag a day
> > > behind?" etc.) and although we mention this in the docs it's a
> confusing
> > > concept.
> > > >>
> > > >> What to people think about adding two new parameters: `period_start`
> > > and `period_end` and making these the preferred terms in place of
> > > execution_date and next_execution_date?
> > > >>
> > > >> This hopefully avoids any ambitious terms like "execution" or "run"
> > > which is understandably easy to conflate with the time the task is
> being
> > > run (i.e. `now()`)
> > > >>
> > > >> If people think this naming is better and less confusing I would
> > > suggest we update all the docs and examples to use these terms (but
> still
> > > mention the old names somewhere, probably in the macros docs)
> > > >>
> > > >> Thoughts?
> > > >>
> > > >> -ash
> > > >>
> > > >>
> > > >>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com
> > > <ma...@gmail.com>> wrote:
> > > >>>
> > > >>> Hi Bas,
> > > >>>
> > > >>> 1) I am aware of a few places where those parameters are used in
> > > production
> > > >>> in a few hundred jobs. I highly recommend we don't deprecate them
> > > unless we
> > > >>> do it in a major version.
> > > >>>
> > > >>> 2) As James mentioned, inlets and outlets are a lineage annotation
> > > feature
> > > >>> which is still under development. Let's leave them in, but we can
> > guard
> > > >>> them behind a feature flag if you prefer.
> > > >>>
> > > >>> 3) the yesterday*/tomorrow* params are convenience ones if you use
> a
> > > daily
> > > >>> ETL. I agree with you that they are simple to compute, but not
> > everyone
> > > >>> using Apache Airflow is amazing with Python. Some users are only
> > > trying to
> > > >>> get a query scheduled and rely on a couple of niceties like these
> to
> > > get by.
> > > >>>
> > > >>> 4) latest_date, end_date (I feel like there used to be start_date,
> > but
> > > >>> maybe it got lost) were a blend of things which were used by a
> > backfill
> > > >>> framework used internally at Airbnb. Latest date was used if you
> > > needed to
> > > >>> join to a dimension for which you only wanted the latest version of
> > the
> > > >>> attributes in you backfill. end_date was used for time ranges where
> > > several
> > > >>> days were processed together in a range to save on compute. I don't
> > > see an
> > > >>> issue with removing them.
> > > >>>
> > > >>> Best regards,
> > > >>> Arthur
> > > >>>
> > > >>>
> > > >>>
> > > >>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > > basharenslak@godatadriven.com <ma...@godatadriven.com>>
> > > >>> wrote:
> > > >>>
> > > >>>> Hi all,
> > > >>>>
> > > >>>> Following Tao Feng’s question to discuss this PR<
> > > >>>> https://github.com/apache/airflow/pull/5010 <
> > > https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> > > >>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > > https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss
> > here
> > > >>>> if you agree/disagree/would change.
> > > >>>>
> > > >>>> -----------
> > > >>>>
> > > >>>> The summary of the PR:
> > > >>>>
> > > >>>> I was confused by the task context values and suggest to clean up
> > and
> > > >>>> clarify these variables. Some are derivations from other
> variables,
> > > some
> > > >>>> are undocumented and unused, some are wrong (name doesn’t match
> the
> > > value).
> > > >>>> Please discuss what you think of the removal of these variables:
> > > >>>>
> > > >>>>
> > > >>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > > >>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> > useful
> > > >>>> since these require complex logic to compute the next execution
> > date,
> > > >>>> however would leave computing the yesterday* and tomorrow*
> variables
> > > up to
> > > >>>> the user since they are simple one-liners and don't relate to the
> > DAG
> > > >>>> interval.
> > > >>>> * Removed tables. This is a field in params, and is thus also
> > > >>>> accessible by the user ({{ params.tables }}). Also, it was
> > > undocumented.
> > > >>>> * Removed latest_date. It's the same as ds and was also
> > > undocumented.
> > > >>>> * Removed inlets and outlets. Also undocumented, and have the
> > > >>>> inlets/outlets ever worked/ever been used by anybody?
> > > >>>> * Removed end_date and END_DATE. Both have the same value, so it
> > > >>>> doesn't make sense to have both variables. Also, the value is ds
> > which
> > > >>>> contains the start date of the interval, so the naming didn't make
> > > sense to
> > > >>>> me. However, if anybody argues in favour of adding "start_date"
> and
> > > >>>> "end_date" to provide the start and end datetime of task instance
> > > >>>> intervals, I'd be happy to add them.
> > > >>>>
> > > >>>> Cheers,
> > > >>>> Bas
> > > >>>>
> > > >>
> > > >
> > > >
> > > >
> > > >
> > >
> >
> ===============================================================================
> > >
> > > > Please access the attached hyperlink for an important electronic
> > > communications disclaimer:
> > > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > > >
> > >
> >
> ===============================================================================
> > >
> > >
> > >
> >
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by "Driesprong, Fokko" <fo...@driesprong.frl>.
I see what you mean. I don't really like the `period_{start,end}` name, but
something such as `interval_{start,end}` might do it for me.
Personally, I think running the job after the interval closes (since then
you have all the data over the interval), makes complete sense for ETL
jobs. I agree it requires some time to get used to. Maybe we're lacking on
documentation here.
Cheers, Fokko
Op wo 10 apr. 2019 om 10:08 schreef Flo Rance <tr...@gmail.com>:
> I didn't expect to participate at any debate on that software, as I'm a
> complete newcomer. But I'm almost forced as I am the target audience, too.
>
> To answer your initial question, after reading a lot of documentation I
> find the term execution_date really counterintuitive, so yes maybe
> period_start and period_end might be a better naming to help to understand
> how all the initial scheduling works. Because even after reading the
> scheduling section of the doc and the FAQ, it was still not clear in my
> mind. Btw, I find some ideas exposed by James Meickle in the [DISCUSS]
> AIRFLOW-4192 very interesting and I share his opinion that there's still
> room for improvement.
> But a mode to change from "run at end of period, I need all the data
> available for this period" (the current) to "run at _this_ time on the
> schedule_interval would be awesome.
>
> Regards,
> Flo
>
> On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor <as...@apache.org> wrote:
>
> > Yeah, that's the other thing that has been talked about from
> time-to-time,
> > which is a mode to change from "run at end of period, I need all the data
> > available for this period" (the current) to "run at _this_ time on the
> > schedule_interval, don't wait for the period to end".
> >
> > (No such flag exists right now, before you go looking.)
> >
> > > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> > damian.shaw.2@credit-suisse.com> wrote:
> > >
> > > Hi all,
> > >
> > > I'm new to this Airflow Dev mailing list so I wasn't expecting to reply
> > to anything but I feel I am the target audience for this question. I am
> > quite new to airflow and have been setting up an airflow environment for
> my
> > business this last month.
> > >
> > > I find the current "execution_date" a small technical burden and a
> large
> > cognitive burden. Our workflow is based on DAGs running at a specified
> time
> > in a specified timezone using the same date as the current calendar date.
> > >
> > > I have worked around this by creating my own macro and context
> > variables, with the logic looking like this:
> > > airflow_execution_date = context['execution_date']
> > > dag_timezone = context['dag'].timezone
> > > local_execution_date =
> > dag_timezone.convert(airflow_execution_date)
> > > local_cal_date = local_execution_date +
> datetime.timedelta(days=1)
> > >
> > > As you can see this isn't a lot of technical effort, but having a date
> > that 1) is in the timezone the business users are working in, and 2) Is
> the
> > same calendar date the business users are working in it significantly
> > reduces the cognitive effort required to set-up tasks. Of course this
> > doesn't help with cron format scheduling which I just let the business
> give
> > me the requirements for and I set it up myself as the date logic there is
> > still confusing as it doesn't work like real cron scheduling which
> everyone
> > is familiar with.
> > >
> > > Maybe "period_start" and "period_end" might help people on Day 0 of
> > understanding Airflow get that the dates you are dealing with are not
> what
> > you expect, but Day 1+ there's still a lot of cognitive overhead if you
> > don't have the exact same model as AirBnb for running DAGs and tasks.
> > >
> > > My 2 cents anyway,
> > > Damian Shaw
> > >
> > >
> > > -----Original Message-----
> > > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > > Sent: Tuesday, April 09, 2019 10:08 AM
> > > To: dev@airflow.apache.org
> > > Subject: [DISCUSS] period_start/period_end instead of
> > execution_date/next_execution_date
> > >
> > > (trying to break this out in to another thread)
> > >
> > > The ML doesn't allow images, but I can guess that it is the deps
> > section of a task instance details screen?
> > >
> > > I'm not saying it's not clear once you know to look there, but I'm
> > trying remove/reduce the confusion in the first place. And I think we as
> > committers aren't best placed to know what makes sense as we have
> > internalised how Airflow works :)
> > >
> > > So I guess this is a question to the newest people on the list: Would
> > `period_start` and `period_end` be more or less confusing for you when
> you
> > were first getting started with Airflow?
> > >
> > > -ash
> > >
> > >> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl>
> > wrote:
> > >>
> > >> Ash,
> > >>
> > >> Personally, I think this is quite clear, there is a list of reasons
> why
> > the job isn't being scheduled:
> > >>
> > >>
> > >> Coming back to the question of Bas, I believe that yesterday_ds does
> > not make sense since we cannot assume that the schedule is daily. I don't
> > see any usage of this variable. Personally, I do use next_execution_date
> > quite extensively. When you have a job that runs daily, but you want to
> > change this to an hourly job. In such a case you don't want to change {{
> > (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date +
> > macros.timedelta(hours=1)) }} everywhere.
> > >>
> > >> I'm just not sure if the aggressive deprecation of is really worth it.
> > I don't see too much harm in letting them stay.
> > >>
> > >> Cheers, Fokko
> > >>
> > >> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <ash@apache.org
> > <ma...@apache.org>>:
> > >> To (slightly) hijack this thread:
> > >>
> > >> On the subject of execuction_date: as I'm sure we're all aware the
> > concept of execution_date is confusing to new-commers to Airflow (there
> are
> > many questions about "why hasn't my DAG run yet"? "Why is my dag a day
> > behind?" etc.) and although we mention this in the docs it's a confusing
> > concept.
> > >>
> > >> What to people think about adding two new parameters: `period_start`
> > and `period_end` and making these the preferred terms in place of
> > execution_date and next_execution_date?
> > >>
> > >> This hopefully avoids any ambitious terms like "execution" or "run"
> > which is understandably easy to conflate with the time the task is being
> > run (i.e. `now()`)
> > >>
> > >> If people think this naming is better and less confusing I would
> > suggest we update all the docs and examples to use these terms (but still
> > mention the old names somewhere, probably in the macros docs)
> > >>
> > >> Thoughts?
> > >>
> > >> -ash
> > >>
> > >>
> > >>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com
> > <ma...@gmail.com>> wrote:
> > >>>
> > >>> Hi Bas,
> > >>>
> > >>> 1) I am aware of a few places where those parameters are used in
> > production
> > >>> in a few hundred jobs. I highly recommend we don't deprecate them
> > unless we
> > >>> do it in a major version.
> > >>>
> > >>> 2) As James mentioned, inlets and outlets are a lineage annotation
> > feature
> > >>> which is still under development. Let's leave them in, but we can
> guard
> > >>> them behind a feature flag if you prefer.
> > >>>
> > >>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> > daily
> > >>> ETL. I agree with you that they are simple to compute, but not
> everyone
> > >>> using Apache Airflow is amazing with Python. Some users are only
> > trying to
> > >>> get a query scheduled and rely on a couple of niceties like these to
> > get by.
> > >>>
> > >>> 4) latest_date, end_date (I feel like there used to be start_date,
> but
> > >>> maybe it got lost) were a blend of things which were used by a
> backfill
> > >>> framework used internally at Airbnb. Latest date was used if you
> > needed to
> > >>> join to a dimension for which you only wanted the latest version of
> the
> > >>> attributes in you backfill. end_date was used for time ranges where
> > several
> > >>> days were processed together in a range to save on compute. I don't
> > see an
> > >>> issue with removing them.
> > >>>
> > >>> Best regards,
> > >>> Arthur
> > >>>
> > >>>
> > >>>
> > >>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > basharenslak@godatadriven.com <ma...@godatadriven.com>>
> > >>> wrote:
> > >>>
> > >>>> Hi all,
> > >>>>
> > >>>> Following Tao Feng’s question to discuss this PR<
> > >>>> https://github.com/apache/airflow/pull/5010 <
> > https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> > >>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> > https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss
> here
> > >>>> if you agree/disagree/would change.
> > >>>>
> > >>>> -----------
> > >>>>
> > >>>> The summary of the PR:
> > >>>>
> > >>>> I was confused by the task context values and suggest to clean up
> and
> > >>>> clarify these variables. Some are derivations from other variables,
> > some
> > >>>> are undocumented and unused, some are wrong (name doesn’t match the
> > value).
> > >>>> Please discuss what you think of the removal of these variables:
> > >>>>
> > >>>>
> > >>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > >>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> useful
> > >>>> since these require complex logic to compute the next execution
> date,
> > >>>> however would leave computing the yesterday* and tomorrow* variables
> > up to
> > >>>> the user since they are simple one-liners and don't relate to the
> DAG
> > >>>> interval.
> > >>>> * Removed tables. This is a field in params, and is thus also
> > >>>> accessible by the user ({{ params.tables }}). Also, it was
> > undocumented.
> > >>>> * Removed latest_date. It's the same as ds and was also
> > undocumented.
> > >>>> * Removed inlets and outlets. Also undocumented, and have the
> > >>>> inlets/outlets ever worked/ever been used by anybody?
> > >>>> * Removed end_date and END_DATE. Both have the same value, so it
> > >>>> doesn't make sense to have both variables. Also, the value is ds
> which
> > >>>> contains the start date of the interval, so the naming didn't make
> > sense to
> > >>>> me. However, if anybody argues in favour of adding "start_date" and
> > >>>> "end_date" to provide the start and end datetime of task instance
> > >>>> intervals, I'd be happy to add them.
> > >>>>
> > >>>> Cheers,
> > >>>> Bas
> > >>>>
> > >>
> > >
> > >
> > >
> > >
> >
> ===============================================================================
> >
> > > Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > >
> >
> ===============================================================================
> >
> >
> >
>
Re: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
Posted by Flo Rance <tr...@gmail.com>.
I didn't expect to participate at any debate on that software, as I'm a
complete newcomer. But I'm almost forced as I am the target audience, too.
To answer your initial question, after reading a lot of documentation I
find the term execution_date really counterintuitive, so yes maybe
period_start and period_end might be a better naming to help to understand
how all the initial scheduling works. Because even after reading the
scheduling section of the doc and the FAQ, it was still not clear in my
mind. Btw, I find some ideas exposed by James Meickle in the [DISCUSS]
AIRFLOW-4192 very interesting and I share his opinion that there's still
room for improvement.
But a mode to change from "run at end of period, I need all the data
available for this period" (the current) to "run at _this_ time on the
schedule_interval would be awesome.
Regards,
Flo
On Tue, Apr 9, 2019 at 4:41 PM Ash Berlin-Taylor <as...@apache.org> wrote:
> Yeah, that's the other thing that has been talked about from time-to-time,
> which is a mode to change from "run at end of period, I need all the data
> available for this period" (the current) to "run at _this_ time on the
> schedule_interval, don't wait for the period to end".
>
> (No such flag exists right now, before you go looking.)
>
> > On 9 Apr 2019, at 15:31, Shaw, Damian P. <
> damian.shaw.2@credit-suisse.com> wrote:
> >
> > Hi all,
> >
> > I'm new to this Airflow Dev mailing list so I wasn't expecting to reply
> to anything but I feel I am the target audience for this question. I am
> quite new to airflow and have been setting up an airflow environment for my
> business this last month.
> >
> > I find the current "execution_date" a small technical burden and a large
> cognitive burden. Our workflow is based on DAGs running at a specified time
> in a specified timezone using the same date as the current calendar date.
> >
> > I have worked around this by creating my own macro and context
> variables, with the logic looking like this:
> > airflow_execution_date = context['execution_date']
> > dag_timezone = context['dag'].timezone
> > local_execution_date =
> dag_timezone.convert(airflow_execution_date)
> > local_cal_date = local_execution_date + datetime.timedelta(days=1)
> >
> > As you can see this isn't a lot of technical effort, but having a date
> that 1) is in the timezone the business users are working in, and 2) Is the
> same calendar date the business users are working in it significantly
> reduces the cognitive effort required to set-up tasks. Of course this
> doesn't help with cron format scheduling which I just let the business give
> me the requirements for and I set it up myself as the date logic there is
> still confusing as it doesn't work like real cron scheduling which everyone
> is familiar with.
> >
> > Maybe "period_start" and "period_end" might help people on Day 0 of
> understanding Airflow get that the dates you are dealing with are not what
> you expect, but Day 1+ there's still a lot of cognitive overhead if you
> don't have the exact same model as AirBnb for running DAGs and tasks.
> >
> > My 2 cents anyway,
> > Damian Shaw
> >
> >
> > -----Original Message-----
> > From: Ash Berlin-Taylor [mailto:ash@apache.org]
> > Sent: Tuesday, April 09, 2019 10:08 AM
> > To: dev@airflow.apache.org
> > Subject: [DISCUSS] period_start/period_end instead of
> execution_date/next_execution_date
> >
> > (trying to break this out in to another thread)
> >
> > The ML doesn't allow images, but I can guess that it is the deps
> section of a task instance details screen?
> >
> > I'm not saying it's not clear once you know to look there, but I'm
> trying remove/reduce the confusion in the first place. And I think we as
> committers aren't best placed to know what makes sense as we have
> internalised how Airflow works :)
> >
> > So I guess this is a question to the newest people on the list: Would
> `period_start` and `period_end` be more or less confusing for you when you
> were first getting started with Airflow?
> >
> > -ash
> >
> >> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl>
> wrote:
> >>
> >> Ash,
> >>
> >> Personally, I think this is quite clear, there is a list of reasons why
> the job isn't being scheduled:
> >>
> >>
> >> Coming back to the question of Bas, I believe that yesterday_ds does
> not make sense since we cannot assume that the schedule is daily. I don't
> see any usage of this variable. Personally, I do use next_execution_date
> quite extensively. When you have a job that runs daily, but you want to
> change this to an hourly job. In such a case you don't want to change {{
> (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date +
> macros.timedelta(hours=1)) }} everywhere.
> >>
> >> I'm just not sure if the aggressive deprecation of is really worth it.
> I don't see too much harm in letting them stay.
> >>
> >> Cheers, Fokko
> >>
> >> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <ash@apache.org
> <ma...@apache.org>>:
> >> To (slightly) hijack this thread:
> >>
> >> On the subject of execuction_date: as I'm sure we're all aware the
> concept of execution_date is confusing to new-commers to Airflow (there are
> many questions about "why hasn't my DAG run yet"? "Why is my dag a day
> behind?" etc.) and although we mention this in the docs it's a confusing
> concept.
> >>
> >> What to people think about adding two new parameters: `period_start`
> and `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
> >>
> >> This hopefully avoids any ambitious terms like "execution" or "run"
> which is understandably easy to conflate with the time the task is being
> run (i.e. `now()`)
> >>
> >> If people think this naming is better and less confusing I would
> suggest we update all the docs and examples to use these terms (but still
> mention the old names somewhere, probably in the macros docs)
> >>
> >> Thoughts?
> >>
> >> -ash
> >>
> >>
> >>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com
> <ma...@gmail.com>> wrote:
> >>>
> >>> Hi Bas,
> >>>
> >>> 1) I am aware of a few places where those parameters are used in
> production
> >>> in a few hundred jobs. I highly recommend we don't deprecate them
> unless we
> >>> do it in a major version.
> >>>
> >>> 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> >>> which is still under development. Let's leave them in, but we can guard
> >>> them behind a feature flag if you prefer.
> >>>
> >>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> >>> ETL. I agree with you that they are simple to compute, but not everyone
> >>> using Apache Airflow is amazing with Python. Some users are only
> trying to
> >>> get a query scheduled and rely on a couple of niceties like these to
> get by.
> >>>
> >>> 4) latest_date, end_date (I feel like there used to be start_date, but
> >>> maybe it got lost) were a blend of things which were used by a backfill
> >>> framework used internally at Airbnb. Latest date was used if you
> needed to
> >>> join to a dimension for which you only wanted the latest version of the
> >>> attributes in you backfill. end_date was used for time ranges where
> several
> >>> days were processed together in a range to save on compute. I don't
> see an
> >>> issue with removing them.
> >>>
> >>> Best regards,
> >>> Arthur
> >>>
> >>>
> >>>
> >>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com <ma...@godatadriven.com>>
> >>> wrote:
> >>>
> >>>> Hi all,
> >>>>
> >>>> Following Tao Feng’s question to discuss this PR<
> >>>> https://github.com/apache/airflow/pull/5010 <
> https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> >>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <
> https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss here
> >>>> if you agree/disagree/would change.
> >>>>
> >>>> -----------
> >>>>
> >>>> The summary of the PR:
> >>>>
> >>>> I was confused by the task context values and suggest to clean up and
> >>>> clarify these variables. Some are derivations from other variables,
> some
> >>>> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> >>>> Please discuss what you think of the removal of these variables:
> >>>>
> >>>>
> >>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> >>>> since these require complex logic to compute the next execution date,
> >>>> however would leave computing the yesterday* and tomorrow* variables
> up to
> >>>> the user since they are simple one-liners and don't relate to the DAG
> >>>> interval.
> >>>> * Removed tables. This is a field in params, and is thus also
> >>>> accessible by the user ({{ params.tables }}). Also, it was
> undocumented.
> >>>> * Removed latest_date. It's the same as ds and was also
> undocumented.
> >>>> * Removed inlets and outlets. Also undocumented, and have the
> >>>> inlets/outlets ever worked/ever been used by anybody?
> >>>> * Removed end_date and END_DATE. Both have the same value, so it
> >>>> doesn't make sense to have both variables. Also, the value is ds which
> >>>> contains the start date of the interval, so the naming didn't make
> sense to
> >>>> me. However, if anybody argues in favour of adding "start_date" and
> >>>> "end_date" to provide the start and end datetime of task instance
> >>>> intervals, I'd be happy to add them.
> >>>>
> >>>> Cheers,
> >>>> Bas
> >>>>
> >>
> >
> >
> >
> >
> ===============================================================================
>
> > Please access the attached hyperlink for an important electronic
> communications disclaimer:
> > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> ===============================================================================
>
>
>
Re: [DISCUSS] period_start/period_end instead of
execution_date/next_execution_date
Posted by Ash Berlin-Taylor <as...@apache.org>.
Yeah, that's the other thing that has been talked about from time-to-time, which is a mode to change from "run at end of period, I need all the data available for this period" (the current) to "run at _this_ time on the schedule_interval, don't wait for the period to end".
(No such flag exists right now, before you go looking.)
> On 9 Apr 2019, at 15:31, Shaw, Damian P. <da...@credit-suisse.com> wrote:
>
> Hi all,
>
> I'm new to this Airflow Dev mailing list so I wasn't expecting to reply to anything but I feel I am the target audience for this question. I am quite new to airflow and have been setting up an airflow environment for my business this last month.
>
> I find the current "execution_date" a small technical burden and a large cognitive burden. Our workflow is based on DAGs running at a specified time in a specified timezone using the same date as the current calendar date.
>
> I have worked around this by creating my own macro and context variables, with the logic looking like this:
> airflow_execution_date = context['execution_date']
> dag_timezone = context['dag'].timezone
> local_execution_date = dag_timezone.convert(airflow_execution_date)
> local_cal_date = local_execution_date + datetime.timedelta(days=1)
>
> As you can see this isn't a lot of technical effort, but having a date that 1) is in the timezone the business users are working in, and 2) Is the same calendar date the business users are working in it significantly reduces the cognitive effort required to set-up tasks. Of course this doesn't help with cron format scheduling which I just let the business give me the requirements for and I set it up myself as the date logic there is still confusing as it doesn't work like real cron scheduling which everyone is familiar with.
>
> Maybe "period_start" and "period_end" might help people on Day 0 of understanding Airflow get that the dates you are dealing with are not what you expect, but Day 1+ there's still a lot of cognitive overhead if you don't have the exact same model as AirBnb for running DAGs and tasks.
>
> My 2 cents anyway,
> Damian Shaw
>
>
> -----Original Message-----
> From: Ash Berlin-Taylor [mailto:ash@apache.org]
> Sent: Tuesday, April 09, 2019 10:08 AM
> To: dev@airflow.apache.org
> Subject: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
>
> (trying to break this out in to another thread)
>
> The ML doesn't allow images, but I can guess that it is the deps section of a task instance details screen?
>
> I'm not saying it's not clear once you know to look there, but I'm trying remove/reduce the confusion in the first place. And I think we as committers aren't best placed to know what makes sense as we have internalised how Airflow works :)
>
> So I guess this is a question to the newest people on the list: Would `period_start` and `period_end` be more or less confusing for you when you were first getting started with Airflow?
>
> -ash
>
>> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl> wrote:
>>
>> Ash,
>>
>> Personally, I think this is quite clear, there is a list of reasons why the job isn't being scheduled:
>>
>>
>> Coming back to the question of Bas, I believe that yesterday_ds does not make sense since we cannot assume that the schedule is daily. I don't see any usage of this variable. Personally, I do use next_execution_date quite extensively. When you have a job that runs daily, but you want to change this to an hourly job. In such a case you don't want to change {{ (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date + macros.timedelta(hours=1)) }} everywhere.
>>
>> I'm just not sure if the aggressive deprecation of is really worth it. I don't see too much harm in letting them stay.
>>
>> Cheers, Fokko
>>
>> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <ash@apache.org <ma...@apache.org>>:
>> To (slightly) hijack this thread:
>>
>> On the subject of execuction_date: as I'm sure we're all aware the concept of execution_date is confusing to new-commers to Airflow (there are many questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?" etc.) and although we mention this in the docs it's a confusing concept.
>>
>> What to people think about adding two new parameters: `period_start` and `period_end` and making these the preferred terms in place of execution_date and next_execution_date?
>>
>> This hopefully avoids any ambitious terms like "execution" or "run" which is understandably easy to conflate with the time the task is being run (i.e. `now()`)
>>
>> If people think this naming is better and less confusing I would suggest we update all the docs and examples to use these terms (but still mention the old names somewhere, probably in the macros docs)
>>
>> Thoughts?
>>
>> -ash
>>
>>
>>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com <ma...@gmail.com>> wrote:
>>>
>>> Hi Bas,
>>>
>>> 1) I am aware of a few places where those parameters are used in production
>>> in a few hundred jobs. I highly recommend we don't deprecate them unless we
>>> do it in a major version.
>>>
>>> 2) As James mentioned, inlets and outlets are a lineage annotation feature
>>> which is still under development. Let's leave them in, but we can guard
>>> them behind a feature flag if you prefer.
>>>
>>> 3) the yesterday*/tomorrow* params are convenience ones if you use a daily
>>> ETL. I agree with you that they are simple to compute, but not everyone
>>> using Apache Airflow is amazing with Python. Some users are only trying to
>>> get a query scheduled and rely on a couple of niceties like these to get by.
>>>
>>> 4) latest_date, end_date (I feel like there used to be start_date, but
>>> maybe it got lost) were a blend of things which were used by a backfill
>>> framework used internally at Airbnb. Latest date was used if you needed to
>>> join to a dimension for which you only wanted the latest version of the
>>> attributes in you backfill. end_date was used for time ranges where several
>>> days were processed together in a range to save on compute. I don't see an
>>> issue with removing them.
>>>
>>> Best regards,
>>> Arthur
>>>
>>>
>>>
>>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <basharenslak@godatadriven.com <ma...@godatadriven.com>>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Following Tao Feng’s question to discuss this PR<
>>>> https://github.com/apache/airflow/pull/5010 <https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
>>>> https://issues.apache.org/jira/browse/AIRFLOW-4192 <https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss here
>>>> if you agree/disagree/would change.
>>>>
>>>> -----------
>>>>
>>>> The summary of the PR:
>>>>
>>>> I was confused by the task context values and suggest to clean up and
>>>> clarify these variables. Some are derivations from other variables, some
>>>> are undocumented and unused, some are wrong (name doesn’t match the value).
>>>> Please discuss what you think of the removal of these variables:
>>>>
>>>>
>>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
>>>> since these require complex logic to compute the next execution date,
>>>> however would leave computing the yesterday* and tomorrow* variables up to
>>>> the user since they are simple one-liners and don't relate to the DAG
>>>> interval.
>>>> * Removed tables. This is a field in params, and is thus also
>>>> accessible by the user ({{ params.tables }}). Also, it was undocumented.
>>>> * Removed latest_date. It's the same as ds and was also undocumented.
>>>> * Removed inlets and outlets. Also undocumented, and have the
>>>> inlets/outlets ever worked/ever been used by anybody?
>>>> * Removed end_date and END_DATE. Both have the same value, so it
>>>> doesn't make sense to have both variables. Also, the value is ds which
>>>> contains the start date of the interval, so the naming didn't make sense to
>>>> me. However, if anybody argues in favour of adding "start_date" and
>>>> "end_date" to provide the start and end datetime of task instance
>>>> intervals, I'd be happy to add them.
>>>>
>>>> Cheers,
>>>> Bas
>>>>
>>
>
>
>
> ===============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===============================================================================
RE: [DISCUSS] period_start/period_end instead of
execution_date/next_execution_date
Posted by "Shaw, Damian P. " <da...@credit-suisse.com>.
Hi all,
I'm new to this Airflow Dev mailing list so I wasn't expecting to reply to anything but I feel I am the target audience for this question. I am quite new to airflow and have been setting up an airflow environment for my business this last month.
I find the current "execution_date" a small technical burden and a large cognitive burden. Our workflow is based on DAGs running at a specified time in a specified timezone using the same date as the current calendar date.
I have worked around this by creating my own macro and context variables, with the logic looking like this:
airflow_execution_date = context['execution_date']
dag_timezone = context['dag'].timezone
local_execution_date = dag_timezone.convert(airflow_execution_date)
local_cal_date = local_execution_date + datetime.timedelta(days=1)
As you can see this isn't a lot of technical effort, but having a date that 1) is in the timezone the business users are working in, and 2) Is the same calendar date the business users are working in it significantly reduces the cognitive effort required to set-up tasks. Of course this doesn't help with cron format scheduling which I just let the business give me the requirements for and I set it up myself as the date logic there is still confusing as it doesn't work like real cron scheduling which everyone is familiar with.
Maybe "period_start" and "period_end" might help people on Day 0 of understanding Airflow get that the dates you are dealing with are not what you expect, but Day 1+ there's still a lot of cognitive overhead if you don't have the exact same model as AirBnb for running DAGs and tasks.
My 2 cents anyway,
Damian Shaw
-----Original Message-----
From: Ash Berlin-Taylor [mailto:ash@apache.org]
Sent: Tuesday, April 09, 2019 10:08 AM
To: dev@airflow.apache.org
Subject: [DISCUSS] period_start/period_end instead of execution_date/next_execution_date
(trying to break this out in to another thread)
The ML doesn't allow images, but I can guess that it is the deps section of a task instance details screen?
I'm not saying it's not clear once you know to look there, but I'm trying remove/reduce the confusion in the first place. And I think we as committers aren't best placed to know what makes sense as we have internalised how Airflow works :)
So I guess this is a question to the newest people on the list: Would `period_start` and `period_end` be more or less confusing for you when you were first getting started with Airflow?
-ash
> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl> wrote:
>
> Ash,
>
> Personally, I think this is quite clear, there is a list of reasons why the job isn't being scheduled:
>
>
> Coming back to the question of Bas, I believe that yesterday_ds does not make sense since we cannot assume that the schedule is daily. I don't see any usage of this variable. Personally, I do use next_execution_date quite extensively. When you have a job that runs daily, but you want to change this to an hourly job. In such a case you don't want to change {{ (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date + macros.timedelta(hours=1)) }} everywhere.
>
> I'm just not sure if the aggressive deprecation of is really worth it. I don't see too much harm in letting them stay.
>
> Cheers, Fokko
>
> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <ash@apache.org <ma...@apache.org>>:
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the concept of execution_date is confusing to new-commers to Airflow (there are many questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?" etc.) and although we mention this in the docs it's a confusing concept.
>
> What to people think about adding two new parameters: `period_start` and `period_end` and making these the preferred terms in place of execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run" which is understandably easy to conflate with the time the task is being run (i.e. `now()`)
>
> If people think this naming is better and less confusing I would suggest we update all the docs and examples to use these terms (but still mention the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> > On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com <ma...@gmail.com>> wrote:
> >
> > Hi Bas,
> >
> > 1) I am aware of a few places where those parameters are used in production
> > in a few hundred jobs. I highly recommend we don't deprecate them unless we
> > do it in a major version.
> >
> > 2) As James mentioned, inlets and outlets are a lineage annotation feature
> > which is still under development. Let's leave them in, but we can guard
> > them behind a feature flag if you prefer.
> >
> > 3) the yesterday*/tomorrow* params are convenience ones if you use a daily
> > ETL. I agree with you that they are simple to compute, but not everyone
> > using Apache Airflow is amazing with Python. Some users are only trying to
> > get a query scheduled and rely on a couple of niceties like these to get by.
> >
> > 4) latest_date, end_date (I feel like there used to be start_date, but
> > maybe it got lost) were a blend of things which were used by a backfill
> > framework used internally at Airbnb. Latest date was used if you needed to
> > join to a dimension for which you only wanted the latest version of the
> > attributes in you backfill. end_date was used for time ranges where several
> > days were processed together in a range to save on compute. I don't see an
> > issue with removing them.
> >
> > Best regards,
> > Arthur
> >
> >
> >
> > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <basharenslak@godatadriven.com <ma...@godatadriven.com>>
> > wrote:
> >
> >> Hi all,
> >>
> >> Following Tao Feng’s question to discuss this PR<
> >> https://github.com/apache/airflow/pull/5010 <https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> >> https://issues.apache.org/jira/browse/AIRFLOW-4192 <https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss here
> >> if you agree/disagree/would change.
> >>
> >> -----------
> >>
> >> The summary of the PR:
> >>
> >> I was confused by the task context values and suggest to clean up and
> >> clarify these variables. Some are derivations from other variables, some
> >> are undocumented and unused, some are wrong (name doesn’t match the value).
> >> Please discuss what you think of the removal of these variables:
> >>
> >>
> >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> >> since these require complex logic to compute the next execution date,
> >> however would leave computing the yesterday* and tomorrow* variables up to
> >> the user since they are simple one-liners and don't relate to the DAG
> >> interval.
> >> * Removed tables. This is a field in params, and is thus also
> >> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> >> * Removed latest_date. It's the same as ds and was also undocumented.
> >> * Removed inlets and outlets. Also undocumented, and have the
> >> inlets/outlets ever worked/ever been used by anybody?
> >> * Removed end_date and END_DATE. Both have the same value, so it
> >> doesn't make sense to have both variables. Also, the value is ds which
> >> contains the start date of the interval, so the naming didn't make sense to
> >> me. However, if anybody argues in favour of adding "start_date" and
> >> "end_date" to provide the start and end datetime of task instance
> >> intervals, I'd be happy to add them.
> >>
> >> Cheers,
> >> Bas
> >>
>
===============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
[DISCUSS] period_start/period_end instead of
execution_date/next_execution_date
Posted by Ash Berlin-Taylor <as...@apache.org>.
(trying to break this out in to another thread)
The ML doesn't allow images, but I can guess that it is the deps section of a task instance details screen?
I'm not saying it's not clear once you know to look there, but I'm trying remove/reduce the confusion in the first place. And I think we as committers aren't best placed to know what makes sense as we have internalised how Airflow works :)
So I guess this is a question to the newest people on the list: Would `period_start` and `period_end` be more or less confusing for you when you were first getting started with Airflow?
-ash
> On 9 Apr 2019, at 14:47, Driesprong, Fokko <fo...@driesprong.frl> wrote:
>
> Ash,
>
> Personally, I think this is quite clear, there is a list of reasons why the job isn't being scheduled:
>
>
> Coming back to the question of Bas, I believe that yesterday_ds does not make sense since we cannot assume that the schedule is daily. I don't see any usage of this variable. Personally, I do use next_execution_date quite extensively. When you have a job that runs daily, but you want to change this to an hourly job. In such a case you don't want to change {{ (execution_date + macros.timedelta(days=1)) }} to {{ (execution_date + macros.timedelta(hours=1)) }} everywhere.
>
> I'm just not sure if the aggressive deprecation of is really worth it. I don't see too much harm in letting them stay.
>
> Cheers, Fokko
>
> Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <ash@apache.org <ma...@apache.org>>:
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the concept of execution_date is confusing to new-commers to Airflow (there are many questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?" etc.) and although we mention this in the docs it's a confusing concept.
>
> What to people think about adding two new parameters: `period_start` and `period_end` and making these the preferred terms in place of execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run" which is understandably easy to conflate with the time the task is being run (i.e. `now()`)
>
> If people think this naming is better and less confusing I would suggest we update all the docs and examples to use these terms (but still mention the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> > On 8 Apr 2019, at 16:20, Arthur Wiedmer <arthur.wiedmer@gmail.com <ma...@gmail.com>> wrote:
> >
> > Hi Bas,
> >
> > 1) I am aware of a few places where those parameters are used in production
> > in a few hundred jobs. I highly recommend we don't deprecate them unless we
> > do it in a major version.
> >
> > 2) As James mentioned, inlets and outlets are a lineage annotation feature
> > which is still under development. Let's leave them in, but we can guard
> > them behind a feature flag if you prefer.
> >
> > 3) the yesterday*/tomorrow* params are convenience ones if you use a daily
> > ETL. I agree with you that they are simple to compute, but not everyone
> > using Apache Airflow is amazing with Python. Some users are only trying to
> > get a query scheduled and rely on a couple of niceties like these to get by.
> >
> > 4) latest_date, end_date (I feel like there used to be start_date, but
> > maybe it got lost) were a blend of things which were used by a backfill
> > framework used internally at Airbnb. Latest date was used if you needed to
> > join to a dimension for which you only wanted the latest version of the
> > attributes in you backfill. end_date was used for time ranges where several
> > days were processed together in a range to save on compute. I don't see an
> > issue with removing them.
> >
> > Best regards,
> > Arthur
> >
> >
> >
> > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <basharenslak@godatadriven.com <ma...@godatadriven.com>>
> > wrote:
> >
> >> Hi all,
> >>
> >> Following Tao Feng’s question to discuss this PR<
> >> https://github.com/apache/airflow/pull/5010 <https://github.com/apache/airflow/pull/5010>> (AIRFLOW-4192<
> >> https://issues.apache.org/jira/browse/AIRFLOW-4192 <https://issues.apache.org/jira/browse/AIRFLOW-4192>>), please discuss here
> >> if you agree/disagree/would change.
> >>
> >> -----------
> >>
> >> The summary of the PR:
> >>
> >> I was confused by the task context values and suggest to clean up and
> >> clarify these variables. Some are derivations from other variables, some
> >> are undocumented and unused, some are wrong (name doesn’t match the value).
> >> Please discuss what you think of the removal of these variables:
> >>
> >>
> >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> >> since these require complex logic to compute the next execution date,
> >> however would leave computing the yesterday* and tomorrow* variables up to
> >> the user since they are simple one-liners and don't relate to the DAG
> >> interval.
> >> * Removed tables. This is a field in params, and is thus also
> >> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> >> * Removed latest_date. It's the same as ds and was also undocumented.
> >> * Removed inlets and outlets. Also undocumented, and have the
> >> inlets/outlets ever worked/ever been used by anybody?
> >> * Removed end_date and END_DATE. Both have the same value, so it
> >> doesn't make sense to have both variables. Also, the value is ds which
> >> contains the start date of the interval, so the naming didn't make sense to
> >> me. However, if anybody argues in favour of adding "start_date" and
> >> "end_date" to provide the start and end datetime of task instance
> >> intervals, I'd be happy to add them.
> >>
> >> Cheers,
> >> Bas
> >>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by "Driesprong, Fokko" <fo...@driesprong.frl>.
Ash,
Personally, I think this is quite clear, there is a list of reasons why the
job isn't being scheduled:
[image: image.png]
Coming back to the question of Bas, I believe that yesterday_ds does not
make sense since we cannot assume that the schedule is daily. I don't see
any usage of this variable. Personally, I do use next_execution_date quite
extensively. When you have a job that runs daily, but you want to change
this to an hourly job. In such a case you don't want to change {{
(execution_date + macros.timedelta(days=1)) }} to {{ (execution_date +
macros.timedelta(hours=1)) }} everywhere.
I'm just not sure if the aggressive deprecation of is really worth it. I
don't see too much harm in letting them stay.
Cheers, Fokko
Op di 9 apr. 2019 om 12:17 schreef Ash Berlin-Taylor <as...@apache.org>:
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the concept
> of execution_date is confusing to new-commers to Airflow (there are many
> questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?"
> etc.) and although we mention this in the docs it's a confusing concept.
>
> What to people think about adding two new parameters: `period_start` and
> `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run" which
> is understandably easy to conflate with the time the task is being run
> (i.e. `now()`)
>
> If people think this naming is better and less confusing I would suggest
> we update all the docs and examples to use these terms (but still mention
> the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> > On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> wrote:
> >
> > Hi Bas,
> >
> > 1) I am aware of a few places where those parameters are used in
> production
> > in a few hundred jobs. I highly recommend we don't deprecate them unless
> we
> > do it in a major version.
> >
> > 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> > which is still under development. Let's leave them in, but we can guard
> > them behind a feature flag if you prefer.
> >
> > 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> > ETL. I agree with you that they are simple to compute, but not everyone
> > using Apache Airflow is amazing with Python. Some users are only trying
> to
> > get a query scheduled and rely on a couple of niceties like these to get
> by.
> >
> > 4) latest_date, end_date (I feel like there used to be start_date, but
> > maybe it got lost) were a blend of things which were used by a backfill
> > framework used internally at Airbnb. Latest date was used if you needed
> to
> > join to a dimension for which you only wanted the latest version of the
> > attributes in you backfill. end_date was used for time ranges where
> several
> > days were processed together in a range to save on compute. I don't see
> an
> > issue with removing them.
> >
> > Best regards,
> > Arthur
> >
> >
> >
> > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com>
> > wrote:
> >
> >> Hi all,
> >>
> >> Following Tao Feng’s question to discuss this PR<
> >> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> >> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> here
> >> if you agree/disagree/would change.
> >>
> >> -----------
> >>
> >> The summary of the PR:
> >>
> >> I was confused by the task context values and suggest to clean up and
> >> clarify these variables. Some are derivations from other variables, some
> >> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> >> Please discuss what you think of the removal of these variables:
> >>
> >>
> >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> >> since these require complex logic to compute the next execution date,
> >> however would leave computing the yesterday* and tomorrow* variables up
> to
> >> the user since they are simple one-liners and don't relate to the DAG
> >> interval.
> >> * Removed tables. This is a field in params, and is thus also
> >> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> >> * Removed latest_date. It's the same as ds and was also undocumented.
> >> * Removed inlets and outlets. Also undocumented, and have the
> >> inlets/outlets ever worked/ever been used by anybody?
> >> * Removed end_date and END_DATE. Both have the same value, so it
> >> doesn't make sense to have both variables. Also, the value is ds which
> >> contains the start date of the interval, so the naming didn't make
> sense to
> >> me. However, if anybody argues in favour of adding "start_date" and
> >> "end_date" to provide the start and end datetime of task instance
> >> intervals, I'd be happy to add them.
> >>
> >> Cheers,
> >> Bas
> >>
>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Maxime Beauchemin <ma...@gmail.com>.
`end_date` is useful, some DAGs / tasks may be scheduled to expire, say an
A/B test in an A/B testing framework with an experiment duration, a
backfill framework, or a framework/UI that allows users to schedule to run
a task to run for say 30 days. I'd keep this one for sure, not all
pipelines / tasks are open ended.
I agree on "tomorrow" and "yesterday", clearly should be "previous" and
"next". My bad, I'm guessing I didn't have enough coffee that day...
Max
On Thu, Apr 11, 2019 at 2:52 PM Driesprong, Fokko <fo...@driesprong.frl>
wrote:
> I agree with Max here, we should be careful.
>
> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. I'm not against having better readable shorthands, but
> more about the fact that having a tomorrow_ds doesn't make sense when we
> have an hourly (or weekly) job.
>
> I'm against guarding the {in,out}lets. Since the guarding will add extra
> logic, and this is not worth the added complexity (and another flag) in my
> opinion.
>
> - We start by putting deprecation warnings on tables, latest_date, end_date
> and END_DATE and remove them in Airflow 2.0.
>
> This is only possible if there is another version before 2.0. Currently,
> we're preparing to move to 2.0
>
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
>
> I'm against guarding the {in,out}lets. Since the guarding will add extra
> logic, and this is not worth the added complexity (and another flag) in my
> opinion.
>
> - We continue discussion about clarification of execution_date and better
> named variables such as something_start and something_end
>
>
> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>
> Cheers, Fokko
>
> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
> basharenslak@godatadriven.com>:
>
> > Great discussion, let’s stay on track. If I can summarise:
> >
> >
> > * yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash
> > * Arthur: some users use these for convenience
> > * Bas/Fokko: these are values that can be easily derived in a
> > one-liner
> >
> > * tables
> > * nobody?
> >
> > * latest_date
> > * Arthur: used by internal backfill framework at Airbnb, but no
> > issue removing them.
> >
> > * inlets/outlets
> > * Arthur: still in development, could be guarded behind feature
> > flag.
> >
> > * end_date/END_DATE
> > * Arthur: used by internal backfill framework at Airbnb, but no
> > issue removing them.
> >
> > And to add to the discussion:
> >
> >
> > * execution_date
> > * The meaning of execution_date is ambivalent and super confusing
> > to everybody because it’s not the date of execution.
> > * Suggestions to add period_start/period_end, or
> > interval_start/interval_end, or something like that, to provide datetime
> > variables for start & end datetime of a DAG run.
> > * Other:
> > * Removal of variables should be done in major version and
> > deprecation warnings should be added.
> >
> > So how about the following:
> > - We start by putting deprecation warnings on tables, latest_date,
> > end_date and END_DATE and remove them in Airflow 2.0.
> > - We add a lineage_enabled config which is false by default and thus
> > inlets/outlets aren’t provided, unless set to true.
> > - We continue discussion about yesterday* and tomorrow*
> > - We continue discussion about clarification of execution_date and better
> > named variables such as something_start and something_end
> >
> > Cheers,
> > Bas
> >
> >
> > On 11 Apr 2019, at 04:52, Maxime Beauchemin <maximebeauchemin@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> > Making backwards incompatible changes that require altering the thousands
> > (millions?!) of DAGs in the wild will alienate the community and prevent
> > many from orchestrating an upgrade. Upgrading hundreds of DAGs and
> Airflow
> > atomically would be hard and dangerous.
> >
> > To mitigate this, changes to the DAG / core API should be backward
> > compatible, at least for a release range, and alert on upcoming
> deprecation
> > (if needed)
> >
> > To be clear if `execution_date` is renamed to `foo`, we should have a
> > version range where both work just as well, but using `execution_date`
> > would result is warning messages about its upcoming deprecation, maybe
> > something like "It appears you're using the task parameter
> `execution_date`
> > which will be deprecated in favor or `foo` in upcoming release 2.0.0,
> find
> > more info at link.to/foo<http://link.to/foo>"
> >
> > Max
> >
> > On Tue, Apr 9, 2019 at 7:58 AM James Meickle
> > <jmeickle@quantopian.com.invalid<mailto:jmeickle@quantopian.com.invalid
> >>
> > wrote:
> >
> > I agree with Ash here. The naming of "execution_date" is incredibly
> > confusing to people who are new to Airflow, who think it has something to
> > do with... execution.
> >
> > However, I think that there's still room for improvement with
> > "period_start" and "period_end". Think about manually triggered tasks -
> > they'd have a "period_start", but no useful "period_end" until the next
> > trigger occurs. And mid-day ETL tasks that are dated to "today" still
> have
> > to reference "period_end" to get the correct date, even though the DAGrun
> > won't be over yet!
> >
> > If we're going to go through and rename "execution_date", I'd rather see
> a
> > wider-ranging rework that understands a mapping from a date to a window
> > (like "every day, process the data from one week ago", or "every
> Saturday,
> > process today's data"). Maybe something closer to how Beam does it
> > (but retaining simplicity for the 99% of cases that are just "run daily,
> > for the past day").
> >
> >
> >
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
> >
> > I could see something where there are two default DAG parameters are:
> > schedule="@daily"
> > window=-1 (or some schedule_delta object that provides a windowing impl,
> or
> > None if there is no window)
> >
> > In this world, all DAGRuns would have a "schedule_date" (the date this
> > would have normally started at), and an "execution_date" (when it was
> > actually executed). If a given DAGrun has a window (one-off DAGs may or
> may
> > not!), there would be variables for "window_start" (the start of the
> > window) and "window_end" (the end of the window; this would default to
> the
> > same as schedule_date, and to the next DAGrun's window_start).
> >
> > Disconnecting schedule date, execution date, and window/period would also
> > open a pathway for more advanced users to implement irregular schedules
> and
> > windows, without having to rely on hacks. For example: a DAG that runs at
> > "the end of the week" to produce a end-of-week would normally run on
> > Friday, but on Friday holidays, instead complete a day early (and scan
> one
> > fewer day in its window).
> >
> > I know there's some historical baggage here, but I think the above is
> much
> > more natural to new users than what we're offering today. And I think
> from
> > a current user perspective, there would be breaking variable name
> changes,
> > but no logical differences for the majority of DAGs.
> >
> > On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org> wrote:
> >
> > To (slightly) hijack this thread:
> >
> > On the subject of execuction_date: as I'm sure we're all aware the
> > concept
> > of execution_date is confusing to new-commers to Airflow (there are many
> > questions about "why hasn't my DAG run yet"? "Why is my dag a day
> > behind?"
> > etc.) and although we mention this in the docs it's a confusing concept.
> >
> > What to people think about adding two new parameters: `period_start` and
> > `period_end` and making these the preferred terms in place of
> > execution_date and next_execution_date?
> >
> > This hopefully avoids any ambitious terms like "execution" or "run" which
> > is understandably easy to conflate with the time the task is being run
> > (i.e. `now()`)
> >
> > If people think this naming is better and less confusing I would suggest
> > we update all the docs and examples to use these terms (but still mention
> > the old names somewhere, probably in the macros docs)
> >
> > Thoughts?
> >
> > -ash
> >
> >
> > On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> > wrote:
> >
> > Hi Bas,
> >
> > 1) I am aware of a few places where those parameters are used in
> > production
> > in a few hundred jobs. I highly recommend we don't deprecate them
> > unless
> > we
> > do it in a major version.
> >
> > 2) As James mentioned, inlets and outlets are a lineage annotation
> > feature
> > which is still under development. Let's leave them in, but we can guard
> > them behind a feature flag if you prefer.
> >
> > 3) the yesterday*/tomorrow* params are convenience ones if you use a
> > daily
> > ETL. I agree with you that they are simple to compute, but not everyone
> > using Apache Airflow is amazing with Python. Some users are only trying
> > to
> > get a query scheduled and rely on a couple of niceties like these to
> > get
> > by.
> >
> > 4) latest_date, end_date (I feel like there used to be start_date, but
> > maybe it got lost) were a blend of things which were used by a backfill
> > framework used internally at Airbnb. Latest date was used if you needed
> > to
> > join to a dimension for which you only wanted the latest version of the
> > attributes in you backfill. end_date was used for time ranges where
> > several
> > days were processed together in a range to save on compute. I don't see
> > an
> > issue with removing them.
> >
> > Best regards,
> > Arthur
> >
> >
> >
> > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > basharenslak@godatadriven.com>
> > wrote:
> >
> > Hi all,
> >
> > Following Tao Feng’s question to discuss this PR<
> > https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> > https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> > here
> > if you agree/disagree/would change.
> >
> > -----------
> >
> > The summary of the PR:
> >
> > I was confused by the task context values and suggest to clean up and
> > clarify these variables. Some are derivations from other variables,
> > some
> > are undocumented and unused, some are wrong (name doesn’t match the
> > value).
> > Please discuss what you think of the removal of these variables:
> >
> >
> > * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> > since these require complex logic to compute the next execution date,
> > however would leave computing the yesterday* and tomorrow* variables
> > up
> > to
> > the user since they are simple one-liners and don't relate to the DAG
> > interval.
> > * Removed tables. This is a field in params, and is thus also
> > accessible by the user ({{ params.tables }}). Also, it was
> > undocumented.
> > * Removed latest_date. It's the same as ds and was also
> > undocumented.
> > * Removed inlets and outlets. Also undocumented, and have the
> > inlets/outlets ever worked/ever been used by anybody?
> > * Removed end_date and END_DATE. Both have the same value, so it
> > doesn't make sense to have both variables. Also, the value is ds which
> > contains the start date of the interval, so the naming didn't make
> > sense to
> > me. However, if anybody argues in favour of adding "start_date" and
> > "end_date" to provide the start and end datetime of task instance
> > intervals, I'd be happy to add them.
> >
> > Cheers,
> > Bas
> >
> >
> >
> >
> >
> >
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Daniel Standish <dp...@gmail.com>.
I would like to add to this discussion a change to
`TaskInstance.previous_ti`. It is a useful property in template context,
but it has an identity crisis.
Currently this property may return a different value depending on whether
your dag is `catchup` and whether your dag has a schedule interval.
- If the dag is catchup, it will calculate the prior execution date
according to schedule and return that TI if one exists.
- If catchup is true and schedule is none then it will return none even
if there is a prior TI.
- If dag is not catchup it will ignore the schedule and return the
absolute prior TI.
I propose that in 2.0 behavior should be as follows:
- *previous_ti* always returns absolute prior ti (i.e. latest prev_ti
such that prev_ti.exec_date < ti.exec_date), if one exists
- add property *previous_scheduled_ti* that returns the prior ti
according to schedule if *it* exists
- consistent with current behavior, if latest ti exec date < prev
sched exec date, it will return None; and if no schedule, return none.
- *note:* there is a PR in progress for *previous_ti_success* -- this
will pick up absolute prior successful TI
This way, the behavior of these properties will not change depending on
unrelated dag params; they should do what advertise, always.
On Tue, Apr 30, 2019 at 11:08 AM Bas Harenslak <
basharenslak@godatadriven.com> wrote:
> Nope. I never planned to have a discussion on execution_date but it
> appeared more important than the other variables mentioned in my first
> email :)
>
> I already wrote a summary halfway this thread. With the updates since then:
>
>
> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash
> * Arthur: some users use these for convenience
> * Bas/Fokko: these are values that can be easily derived in a
> one-liner
> * Max agrees these should have been previous_* and next_* execution
> date. No such thing as temporary code :-)
>
> * tables
> * Fokko: deprecate and remove in Airflow 2.0
> * latest_date
> * Arthur: used by internal backfill framework at Airbnb, but no
> issue removing them
> * Fokko: deprecate and remove in Airflow 2.0
> * inlets/outlets
> * Arthur: still in development, could be guarded behind feature
> flag.
> * Fokko: no guarding, it adds additional logic
> * Bolke: still in development
> * end_date/END_DATE
> * Arthur: used by internal backfill framework at Airbnb, but no
> issue removing them.
> * Fokko: deprecate and remove in Airflow 2.0
> * Max finds it useful with a reason (but ignored the fact it’s
> actually the start date of the interval?)
> * Bolke says there’s some users
> * Others question if there are any
> * execution_date
> * The meaning of execution_date is ambivalent and super confusing
> to everybody because it’s not the date of execution.
> * Suggestions to add period_start/period_end, or
> interval_start/interval_end, or something like that, to provide datetime
> variables for start & end datetime of a DAG run.
> * Most agree to add new variables with more sensible names and keep
> execution_date for backwards compatibility
> * Other:
> * Removal of variables should be done in major version and
> deprecation warnings should be added.
>
> So, given the discussion it appears almost everybody agrees these
> variables are incorrect and/or confusing. However, there are also users
> depending on them. How about we:
>
>
> 1. Create new variables with sensible names
> 2. At least deprecate tables & latest_date as these appear not
> important to anybody
>
> Cheers,
> Bas
>
> On 30 Apr 2019, at 19:23, Ash Berlin-Taylor <ash@apache.org<mailto:
> ash@apache.org>> wrote:
>
> Did we come to any conclusion on this topic?
>
>
> On 12 Apr 2019, at 10:26, Ash Berlin-Taylor <ash@apache.org<mailto:
> ash@apache.org>> wrote:
>
> Does anyone actually use end_date (of either spelling) given it's value is
> currently the same as `ds`:
> https://github.com/apache/airflow/blob/3020d9733cb189f091489a62f58f0f586dc8d4a9/airflow/models/taskinstance.py#L1183-L1184
>
>
> 'END_DATE': ds,
> 'end_date': ds,
>
> That seems like it is just the wrong value - I could see it being useful
> as either the same value as `next_execution_date` or `dag.end_date` but the
> current value (from a quick thought) doesn't seem like it is useful?
>
> Given what the value is currently set to I vote for deprecating/removing
> these two.
>
> On 12 Apr 2019, at 09:39, Bolke de Bruin <bdbruin@gmail.com<mailto:
> bdbruin@gmail.com>> wrote:
>
> I don’t think guarding inlets and outlets makes sense, cause if they are
> not defined they code won’t be executed anyway. Ie. The logic is already
> there, no need for a config flag.
>
> End-date is actually used by some beyond Airbnb as far as I know. What is
> the reason for deprecating it?
>
> Execution_date in finance is actually very well known. A transaction has
> an execution date it is not the time of the sending of the data. I honestly
> think that a change here would make it a thing that techies understand but
> does not make business sense. What is “today’s data?” it might not be the
> data that was sent today.
>
>
>
> Verstuurd vanaf mijn iPad
>
> Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <
> maximebeauchemin@gmail.com<ma...@gmail.com>> het
> volgende geschreven:
>
> It should be labelled as a "bridge" or "transition" release somehow, and
> tell the community to absolutely to go there first and address all
> deprecation warnings prior to upgrade to 2.0. I wonder if semver has
> something for that.
>
> It might be the time to deprecate more things. Spring cleaning!
>
> Should we start another thread labeled "[2.0 spring cleaning] what Airflow
> features should we deprecate!?"
>
> Max
>
> On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <ash@apache.org<mailto:
> ash@apache.org>> wrote:
>
> I am happy to do another small(!) 1.10.x release.
>
> (There was a small bug I introduced where I broke the rendering of doc_md
> on dags)
>
> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fokko@driesprong.frl
> <ma...@driesprong.frl>>
> wrote:
> I agree with Max here, we should be careful.
>
> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. I'm not against having better readable shorthands,
> but
> more about the fact that having a tomorrow_ds doesn't make sense when
> we
> have an hourly (or weekly) job.
>
> I'm against guarding the {in,out}lets. Since the guarding will add
> extra
> logic, and this is not worth the added complexity (and another flag) in
> my
> opinion.
>
> - We start by putting deprecation warnings on tables, latest_date,
> end_date
> and END_DATE and remove them in Airflow 2.0.
>
> This is only possible if there is another version before 2.0.
> Currently,
> we're preparing to move to 2.0
>
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
>
> I'm against guarding the {in,out}lets. Since the guarding will add
> extra
> logic, and this is not worth the added complexity (and another flag) in
> my
> opinion.
>
> - We continue discussion about clarification of execution_date and
> better
> named variables such as something_start and something_end
>
>
>
> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>
> Cheers, Fokko
>
> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
> basharenslak@godatadriven.com>:
>
> Great discussion, let’s stay on track. If I can summarise:
>
>
> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash
> * Arthur: some users use these for convenience
> * Bas/Fokko: these are values that can be easily derived in a
> one-liner
>
> * tables
> * nobody?
>
> * latest_date
> * Arthur: used by internal backfill framework at Airbnb, but
> no
> issue removing them.
>
> * inlets/outlets
> * Arthur: still in development, could be guarded behind
> feature
> flag.
>
> * end_date/END_DATE
> * Arthur: used by internal backfill framework at Airbnb, but
> no
> issue removing them.
>
> And to add to the discussion:
>
>
> * execution_date
> * The meaning of execution_date is ambivalent and super
> confusing
> to everybody because it’s not the date of execution.
> * Suggestions to add period_start/period_end, or
> interval_start/interval_end, or something like that, to provide
> datetime
> variables for start & end datetime of a DAG run.
> * Other:
> * Removal of variables should be done in major version and
> deprecation warnings should be added.
>
> So how about the following:
> - We start by putting deprecation warnings on tables, latest_date,
> end_date and END_DATE and remove them in Airflow 2.0.
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
> - We continue discussion about yesterday* and tomorrow*
> - We continue discussion about clarification of execution_date and
> better
> named variables such as something_start and something_end
>
> Cheers,
> Bas
>
>
> On 11 Apr 2019, at 04:52, Maxime Beauchemin
> <maximebeauchemin@gmail.com
> <ma...@gmail.com>> wrote:
>
> Making backwards incompatible changes that require altering the
> thousands
> (millions?!) of DAGs in the wild will alienate the community and
> prevent
> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
> Airflow
> atomically would be hard and dangerous.
>
> To mitigate this, changes to the DAG / core API should be backward
> compatible, at least for a release range, and alert on upcoming
> deprecation
> (if needed)
>
> To be clear if `execution_date` is renamed to `foo`, we should have a
> version range where both work just as well, but using
> `execution_date`
> would result is warning messages about its upcoming deprecation,
> maybe
> something like "It appears you're using the task parameter
> `execution_date`
> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
> find
> more info at link.to/foo<http://link.to/foo>"
>
> Max
>
> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>
> <jm...@quantopian.com.invalid>>
> wrote:
>
> I agree with Ash here. The naming of "execution_date" is incredibly
> confusing to people who are new to Airflow, who think it has
> something to
> do with... execution.
>
> However, I think that there's still room for improvement with
> "period_start" and "period_end". Think about manually triggered tasks
> -
> they'd have a "period_start", but no useful "period_end" until the
> next
> trigger occurs. And mid-day ETL tasks that are dated to "today" still
> have
> to reference "period_end" to get the correct date, even though the
> DAGrun
> won't be over yet!
>
> If we're going to go through and rename "execution_date", I'd rather
> see a
> wider-ranging rework that understands a mapping from a date to a
> window
> (like "every day, process the data from one week ago", or "every
> Saturday,
> process today's data"). Maybe something closer to how Beam does it
> (but retaining simplicity for the 99% of cases that are just "run
> daily,
> for the past day").
>
>
>
>
>
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>
> I could see something where there are two default DAG parameters are:
> schedule="@daily"
> window=-1 (or some schedule_delta object that provides a windowing
> impl, or
> None if there is no window)
>
> In this world, all DAGRuns would have a "schedule_date" (the date
> this
> would have normally started at), and an "execution_date" (when it was
> actually executed). If a given DAGrun has a window (one-off DAGs may
> or may
> not!), there would be variables for "window_start" (the start of the
> window) and "window_end" (the end of the window; this would default
> to the
> same as schedule_date, and to the next DAGrun's window_start).
>
> Disconnecting schedule date, execution date, and window/period would
> also
> open a pathway for more advanced users to implement irregular
> schedules and
> windows, without having to rely on hacks. For example: a DAG that
> runs at
> "the end of the week" to produce a end-of-week would normally run on
> Friday, but on Friday holidays, instead complete a day early (and
> scan one
> fewer day in its window).
>
> I know there's some historical baggage here, but I think the above is
> much
> more natural to new users than what we're offering today. And I think
> from
> a current user perspective, there would be breaking variable name
> changes,
> but no logical differences for the majority of DAGs.
>
> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
> wrote:
>
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the
> concept
> of execution_date is confusing to new-commers to Airflow (there are
> many
> questions about "why hasn't my DAG run yet"? "Why is my dag a day
> behind?"
> etc.) and although we mention this in the docs it's a confusing
> concept.
>
> What to people think about adding two new parameters: `period_start`
> and
> `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run"
> which
> is understandably easy to conflate with the time the task is being
> run
> (i.e. `now()`)
>
> If people think this naming is better and less confusing I would
> suggest
> we update all the docs and examples to use these terms (but still
> mention
> the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> wrote:
>
> Hi Bas,
>
> 1) I am aware of a few places where those parameters are used in
> production
> in a few hundred jobs. I highly recommend we don't deprecate them
> unless
> we
> do it in a major version.
>
> 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> which is still under development. Let's leave them in, but we can
> guard
> them behind a feature flag if you prefer.
>
> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> ETL. I agree with you that they are simple to compute, but not
> everyone
> using Apache Airflow is amazing with Python. Some users are only
> trying
> to
> get a query scheduled and rely on a couple of niceties like these to
> get
> by.
>
> 4) latest_date, end_date (I feel like there used to be start_date,
> but
> maybe it got lost) were a blend of things which were used by a
> backfill
> framework used internally at Airbnb. Latest date was used if you
> needed
> to
> join to a dimension for which you only wanted the latest version of
> the
> attributes in you backfill. end_date was used for time ranges where
> several
> days were processed together in a range to save on compute. I don't
> see
> an
> issue with removing them.
>
> Best regards,
> Arthur
>
>
>
> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com>
> wrote:
>
> Hi all,
>
> Following Tao Feng’s question to discuss this PR<
> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> here
> if you agree/disagree/would change.
>
> -----------
>
> The summary of the PR:
>
> I was confused by the task context values and suggest to clean up and
> clarify these variables. Some are derivations from other variables,
> some
> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> Please discuss what you think of the removal of these variables:
>
>
> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> useful
> since these require complex logic to compute the next execution date,
> however would leave computing the yesterday* and tomorrow* variables
> up
> to
> the user since they are simple one-liners and don't relate to the DAG
> interval.
> * Removed tables. This is a field in params, and is thus also
> accessible by the user ({{ params.tables }}). Also, it was
> undocumented.
> * Removed latest_date. It's the same as ds and was also
> undocumented.
> * Removed inlets and outlets. Also undocumented, and have the
> inlets/outlets ever worked/ever been used by anybody?
> * Removed end_date and END_DATE. Both have the same value, so it
> doesn't make sense to have both variables. Also, the value is ds
> which
> contains the start date of the interval, so the naming didn't make
> sense to
> me. However, if anybody argues in favour of adding "start_date" and
> "end_date" to provide the start and end datetime of task instance
> intervals, I'd be happy to add them.
>
> Cheers,
> Bas
>
>
>
>
>
>
>
>
>
>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Bas Harenslak <ba...@godatadriven.com>.
Nope. I never planned to have a discussion on execution_date but it appeared more important than the other variables mentioned in my first email :)
I already wrote a summary halfway this thread. With the updates since then:
* yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash
* Arthur: some users use these for convenience
* Bas/Fokko: these are values that can be easily derived in a one-liner
* Max agrees these should have been previous_* and next_* execution date. No such thing as temporary code :-)
* tables
* Fokko: deprecate and remove in Airflow 2.0
* latest_date
* Arthur: used by internal backfill framework at Airbnb, but no issue removing them
* Fokko: deprecate and remove in Airflow 2.0
* inlets/outlets
* Arthur: still in development, could be guarded behind feature flag.
* Fokko: no guarding, it adds additional logic
* Bolke: still in development
* end_date/END_DATE
* Arthur: used by internal backfill framework at Airbnb, but no issue removing them.
* Fokko: deprecate and remove in Airflow 2.0
* Max finds it useful with a reason (but ignored the fact it’s actually the start date of the interval?)
* Bolke says there’s some users
* Others question if there are any
* execution_date
* The meaning of execution_date is ambivalent and super confusing to everybody because it’s not the date of execution.
* Suggestions to add period_start/period_end, or interval_start/interval_end, or something like that, to provide datetime variables for start & end datetime of a DAG run.
* Most agree to add new variables with more sensible names and keep execution_date for backwards compatibility
* Other:
* Removal of variables should be done in major version and deprecation warnings should be added.
So, given the discussion it appears almost everybody agrees these variables are incorrect and/or confusing. However, there are also users depending on them. How about we:
1. Create new variables with sensible names
2. At least deprecate tables & latest_date as these appear not important to anybody
Cheers,
Bas
On 30 Apr 2019, at 19:23, Ash Berlin-Taylor <as...@apache.org>> wrote:
Did we come to any conclusion on this topic?
On 12 Apr 2019, at 10:26, Ash Berlin-Taylor <as...@apache.org>> wrote:
Does anyone actually use end_date (of either spelling) given it's value is currently the same as `ds`: https://github.com/apache/airflow/blob/3020d9733cb189f091489a62f58f0f586dc8d4a9/airflow/models/taskinstance.py#L1183-L1184
'END_DATE': ds,
'end_date': ds,
That seems like it is just the wrong value - I could see it being useful as either the same value as `next_execution_date` or `dag.end_date` but the current value (from a quick thought) doesn't seem like it is useful?
Given what the value is currently set to I vote for deprecating/removing these two.
On 12 Apr 2019, at 09:39, Bolke de Bruin <bd...@gmail.com>> wrote:
I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
Verstuurd vanaf mijn iPad
Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com>> het volgende geschreven:
It should be labelled as a "bridge" or "transition" release somehow, and
tell the community to absolutely to go there first and address all
deprecation warnings prior to upgrade to 2.0. I wonder if semver has
something for that.
It might be the time to deprecate more things. Spring cleaning!
Should we start another thread labeled "[2.0 spring cleaning] what Airflow
features should we deprecate!?"
Max
On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org>> wrote:
I am happy to do another small(!) 1.10.x release.
(There was a small bug I introduced where I broke the rendering of doc_md
on dags)
On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>>
wrote:
I agree with Max here, we should be careful.
Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. I'm not against having better readable shorthands,
but
more about the fact that having a tomorrow_ds doesn't make sense when
we
have an hourly (or weekly) job.
I'm against guarding the {in,out}lets. Since the guarding will add
extra
logic, and this is not worth the added complexity (and another flag) in
my
opinion.
- We start by putting deprecation warnings on tables, latest_date,
end_date
and END_DATE and remove them in Airflow 2.0.
This is only possible if there is another version before 2.0.
Currently,
we're preparing to move to 2.0
- We add a lineage_enabled config which is false by default and thus
inlets/outlets aren’t provided, unless set to true.
I'm against guarding the {in,out}lets. Since the guarding will add
extra
logic, and this is not worth the added complexity (and another flag) in
my
opinion.
- We continue discussion about clarification of execution_date and
better
named variables such as something_start and something_end
https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
Cheers, Fokko
Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
basharenslak@godatadriven.com>:
Great discussion, let’s stay on track. If I can summarise:
* yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash
* Arthur: some users use these for convenience
* Bas/Fokko: these are values that can be easily derived in a
one-liner
* tables
* nobody?
* latest_date
* Arthur: used by internal backfill framework at Airbnb, but
no
issue removing them.
* inlets/outlets
* Arthur: still in development, could be guarded behind
feature
flag.
* end_date/END_DATE
* Arthur: used by internal backfill framework at Airbnb, but
no
issue removing them.
And to add to the discussion:
* execution_date
* The meaning of execution_date is ambivalent and super
confusing
to everybody because it’s not the date of execution.
* Suggestions to add period_start/period_end, or
interval_start/interval_end, or something like that, to provide
datetime
variables for start & end datetime of a DAG run.
* Other:
* Removal of variables should be done in major version and
deprecation warnings should be added.
So how about the following:
- We start by putting deprecation warnings on tables, latest_date,
end_date and END_DATE and remove them in Airflow 2.0.
- We add a lineage_enabled config which is false by default and thus
inlets/outlets aren’t provided, unless set to true.
- We continue discussion about yesterday* and tomorrow*
- We continue discussion about clarification of execution_date and
better
named variables such as something_start and something_end
Cheers,
Bas
On 11 Apr 2019, at 04:52, Maxime Beauchemin
<maximebeauchemin@gmail.com
<ma...@gmail.com>> wrote:
Making backwards incompatible changes that require altering the
thousands
(millions?!) of DAGs in the wild will alienate the community and
prevent
many from orchestrating an upgrade. Upgrading hundreds of DAGs and
Airflow
atomically would be hard and dangerous.
To mitigate this, changes to the DAG / core API should be backward
compatible, at least for a release range, and alert on upcoming
deprecation
(if needed)
To be clear if `execution_date` is renamed to `foo`, we should have a
version range where both work just as well, but using
`execution_date`
would result is warning messages about its upcoming deprecation,
maybe
something like "It appears you're using the task parameter
`execution_date`
which will be deprecated in favor or `foo` in upcoming release 2.0.0,
find
more info at link.to/foo<http://link.to/foo>"
Max
On Tue, Apr 9, 2019 at 7:58 AM James Meickle
<jm...@quantopian.com.invalid>>
wrote:
I agree with Ash here. The naming of "execution_date" is incredibly
confusing to people who are new to Airflow, who think it has
something to
do with... execution.
However, I think that there's still room for improvement with
"period_start" and "period_end". Think about manually triggered tasks
-
they'd have a "period_start", but no useful "period_end" until the
next
trigger occurs. And mid-day ETL tasks that are dated to "today" still
have
to reference "period_end" to get the correct date, even though the
DAGrun
won't be over yet!
If we're going to go through and rename "execution_date", I'd rather
see a
wider-ranging rework that understands a mapping from a date to a
window
(like "every day, process the data from one week ago", or "every
Saturday,
process today's data"). Maybe something closer to how Beam does it
(but retaining simplicity for the 99% of cases that are just "run
daily,
for the past day").
https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
I could see something where there are two default DAG parameters are:
schedule="@daily"
window=-1 (or some schedule_delta object that provides a windowing
impl, or
None if there is no window)
In this world, all DAGRuns would have a "schedule_date" (the date
this
would have normally started at), and an "execution_date" (when it was
actually executed). If a given DAGrun has a window (one-off DAGs may
or may
not!), there would be variables for "window_start" (the start of the
window) and "window_end" (the end of the window; this would default
to the
same as schedule_date, and to the next DAGrun's window_start).
Disconnecting schedule date, execution date, and window/period would
also
open a pathway for more advanced users to implement irregular
schedules and
windows, without having to rely on hacks. For example: a DAG that
runs at
"the end of the week" to produce a end-of-week would normally run on
Friday, but on Friday holidays, instead complete a day early (and
scan one
fewer day in its window).
I know there's some historical baggage here, but I think the above is
much
more natural to new users than what we're offering today. And I think
from
a current user perspective, there would be breaking variable name
changes,
but no logical differences for the majority of DAGs.
On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
wrote:
To (slightly) hijack this thread:
On the subject of execuction_date: as I'm sure we're all aware the
concept
of execution_date is confusing to new-commers to Airflow (there are
many
questions about "why hasn't my DAG run yet"? "Why is my dag a day
behind?"
etc.) and although we mention this in the docs it's a confusing
concept.
What to people think about adding two new parameters: `period_start`
and
`period_end` and making these the preferred terms in place of
execution_date and next_execution_date?
This hopefully avoids any ambitious terms like "execution" or "run"
which
is understandably easy to conflate with the time the task is being
run
(i.e. `now()`)
If people think this naming is better and less confusing I would
suggest
we update all the docs and examples to use these terms (but still
mention
the old names somewhere, probably in the macros docs)
Thoughts?
-ash
On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
wrote:
Hi Bas,
1) I am aware of a few places where those parameters are used in
production
in a few hundred jobs. I highly recommend we don't deprecate them
unless
we
do it in a major version.
2) As James mentioned, inlets and outlets are a lineage annotation
feature
which is still under development. Let's leave them in, but we can
guard
them behind a feature flag if you prefer.
3) the yesterday*/tomorrow* params are convenience ones if you use a
daily
ETL. I agree with you that they are simple to compute, but not
everyone
using Apache Airflow is amazing with Python. Some users are only
trying
to
get a query scheduled and rely on a couple of niceties like these to
get
by.
4) latest_date, end_date (I feel like there used to be start_date,
but
maybe it got lost) were a blend of things which were used by a
backfill
framework used internally at Airbnb. Latest date was used if you
needed
to
join to a dimension for which you only wanted the latest version of
the
attributes in you backfill. end_date was used for time ranges where
several
days were processed together in a range to save on compute. I don't
see
an
issue with removing them.
Best regards,
Arthur
On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
basharenslak@godatadriven.com>
wrote:
Hi all,
Following Tao Feng’s question to discuss this PR<
https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
here
if you agree/disagree/would change.
-----------
The summary of the PR:
I was confused by the task context values and suggest to clean up and
clarify these variables. Some are derivations from other variables,
some
are undocumented and unused, some are wrong (name doesn’t match the
value).
Please discuss what you think of the removal of these variables:
* Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. IMO the next_* and previous_* variables are
useful
since these require complex logic to compute the next execution date,
however would leave computing the yesterday* and tomorrow* variables
up
to
the user since they are simple one-liners and don't relate to the DAG
interval.
* Removed tables. This is a field in params, and is thus also
accessible by the user ({{ params.tables }}). Also, it was
undocumented.
* Removed latest_date. It's the same as ds and was also
undocumented.
* Removed inlets and outlets. Also undocumented, and have the
inlets/outlets ever worked/ever been used by anybody?
* Removed end_date and END_DATE. Both have the same value, so it
doesn't make sense to have both variables. Also, the value is ds
which
contains the start date of the interval, so the naming didn't make
sense to
me. However, if anybody argues in favour of adding "start_date" and
"end_date" to provide the start and end datetime of task instance
intervals, I'd be happy to add them.
Cheers,
Bas
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Ash Berlin-Taylor <as...@apache.org>.
Did we come to any conclusion on this topic?
> On 12 Apr 2019, at 10:26, Ash Berlin-Taylor <as...@apache.org> wrote:
>
> Does anyone actually use end_date (of either spelling) given it's value is currently the same as `ds`: https://github.com/apache/airflow/blob/3020d9733cb189f091489a62f58f0f586dc8d4a9/airflow/models/taskinstance.py#L1183-L1184
>
>
> 'END_DATE': ds,
> 'end_date': ds,
>
> That seems like it is just the wrong value - I could see it being useful as either the same value as `next_execution_date` or `dag.end_date` but the current value (from a quick thought) doesn't seem like it is useful?
>
> Given what the value is currently set to I vote for deprecating/removing these two.
>
>> On 12 Apr 2019, at 09:39, Bolke de Bruin <bd...@gmail.com> wrote:
>>
>> I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
>>
>> End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
>>
>> Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
>>
>>
>>
>> Verstuurd vanaf mijn iPad
>>
>>> Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com> het volgende geschreven:
>>>
>>> It should be labelled as a "bridge" or "transition" release somehow, and
>>> tell the community to absolutely to go there first and address all
>>> deprecation warnings prior to upgrade to 2.0. I wonder if semver has
>>> something for that.
>>>
>>> It might be the time to deprecate more things. Spring cleaning!
>>>
>>> Should we start another thread labeled "[2.0 spring cleaning] what Airflow
>>> features should we deprecate!?"
>>>
>>> Max
>>>
>>>> On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org> wrote:
>>>>
>>>> I am happy to do another small(!) 1.10.x release.
>>>>
>>>> (There was a small bug I introduced where I broke the rendering of doc_md
>>>> on dags)
>>>>
>>>> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>
>>>> wrote:
>>>>> I agree with Max here, we should be careful.
>>>>>
>>>>> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>>> tomorrow_ds_nodash. I'm not against having better readable shorthands,
>>>>> but
>>>>> more about the fact that having a tomorrow_ds doesn't make sense when
>>>>> we
>>>>> have an hourly (or weekly) job.
>>>>>
>>>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>>>> extra
>>>>> logic, and this is not worth the added complexity (and another flag) in
>>>>> my
>>>>> opinion.
>>>>>
>>>>> - We start by putting deprecation warnings on tables, latest_date,
>>>>> end_date
>>>>> and END_DATE and remove them in Airflow 2.0.
>>>>>
>>>>> This is only possible if there is another version before 2.0.
>>>>> Currently,
>>>>> we're preparing to move to 2.0
>>>>>
>>>>> - We add a lineage_enabled config which is false by default and thus
>>>>> inlets/outlets aren’t provided, unless set to true.
>>>>>
>>>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>>>> extra
>>>>> logic, and this is not worth the added complexity (and another flag) in
>>>>> my
>>>>> opinion.
>>>>>
>>>>> - We continue discussion about clarification of execution_date and
>>>>> better
>>>>> named variables such as something_start and something_end
>>>>>
>>>>>
>>>> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>>>>>
>>>>> Cheers, Fokko
>>>>>
>>>>> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
>>>>> basharenslak@godatadriven.com>:
>>>>>
>>>>>> Great discussion, let’s stay on track. If I can summarise:
>>>>>>
>>>>>>
>>>>>> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>>> tomorrow_ds_nodash
>>>>>> * Arthur: some users use these for convenience
>>>>>> * Bas/Fokko: these are values that can be easily derived in a
>>>>>> one-liner
>>>>>>
>>>>>> * tables
>>>>>> * nobody?
>>>>>>
>>>>>> * latest_date
>>>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>>>> no
>>>>>> issue removing them.
>>>>>>
>>>>>> * inlets/outlets
>>>>>> * Arthur: still in development, could be guarded behind
>>>>> feature
>>>>>> flag.
>>>>>>
>>>>>> * end_date/END_DATE
>>>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>>>> no
>>>>>> issue removing them.
>>>>>>
>>>>>> And to add to the discussion:
>>>>>>
>>>>>>
>>>>>> * execution_date
>>>>>> * The meaning of execution_date is ambivalent and super
>>>>> confusing
>>>>>> to everybody because it’s not the date of execution.
>>>>>> * Suggestions to add period_start/period_end, or
>>>>>> interval_start/interval_end, or something like that, to provide
>>>>> datetime
>>>>>> variables for start & end datetime of a DAG run.
>>>>>> * Other:
>>>>>> * Removal of variables should be done in major version and
>>>>>> deprecation warnings should be added.
>>>>>>
>>>>>> So how about the following:
>>>>>> - We start by putting deprecation warnings on tables, latest_date,
>>>>>> end_date and END_DATE and remove them in Airflow 2.0.
>>>>>> - We add a lineage_enabled config which is false by default and thus
>>>>>> inlets/outlets aren’t provided, unless set to true.
>>>>>> - We continue discussion about yesterday* and tomorrow*
>>>>>> - We continue discussion about clarification of execution_date and
>>>>> better
>>>>>> named variables such as something_start and something_end
>>>>>>
>>>>>> Cheers,
>>>>>> Bas
>>>>>>
>>>>>>
>>>>>> On 11 Apr 2019, at 04:52, Maxime Beauchemin
>>>>> <maximebeauchemin@gmail.com
>>>>>> <ma...@gmail.com>> wrote:
>>>>>>
>>>>>> Making backwards incompatible changes that require altering the
>>>>> thousands
>>>>>> (millions?!) of DAGs in the wild will alienate the community and
>>>>> prevent
>>>>>> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
>>>>> Airflow
>>>>>> atomically would be hard and dangerous.
>>>>>>
>>>>>> To mitigate this, changes to the DAG / core API should be backward
>>>>>> compatible, at least for a release range, and alert on upcoming
>>>>> deprecation
>>>>>> (if needed)
>>>>>>
>>>>>> To be clear if `execution_date` is renamed to `foo`, we should have a
>>>>>> version range where both work just as well, but using
>>>>> `execution_date`
>>>>>> would result is warning messages about its upcoming deprecation,
>>>>> maybe
>>>>>> something like "It appears you're using the task parameter
>>>>> `execution_date`
>>>>>> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
>>>>> find
>>>>>> more info at link.to/foo<http://link.to/foo>"
>>>>>>
>>>>>> Max
>>>>>>
>>>>>> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>>>>>>
>>>>> <jm...@quantopian.com.invalid>>
>>>>>> wrote:
>>>>>>
>>>>>> I agree with Ash here. The naming of "execution_date" is incredibly
>>>>>> confusing to people who are new to Airflow, who think it has
>>>>> something to
>>>>>> do with... execution.
>>>>>>
>>>>>> However, I think that there's still room for improvement with
>>>>>> "period_start" and "period_end". Think about manually triggered tasks
>>>>> -
>>>>>> they'd have a "period_start", but no useful "period_end" until the
>>>>> next
>>>>>> trigger occurs. And mid-day ETL tasks that are dated to "today" still
>>>>> have
>>>>>> to reference "period_end" to get the correct date, even though the
>>>>> DAGrun
>>>>>> won't be over yet!
>>>>>>
>>>>>> If we're going to go through and rename "execution_date", I'd rather
>>>>> see a
>>>>>> wider-ranging rework that understands a mapping from a date to a
>>>>> window
>>>>>> (like "every day, process the data from one week ago", or "every
>>>>> Saturday,
>>>>>> process today's data"). Maybe something closer to how Beam does it
>>>>>> (but retaining simplicity for the 99% of cases that are just "run
>>>>> daily,
>>>>>> for the past day").
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>>>>>>
>>>>>> I could see something where there are two default DAG parameters are:
>>>>>> schedule="@daily"
>>>>>> window=-1 (or some schedule_delta object that provides a windowing
>>>>> impl, or
>>>>>> None if there is no window)
>>>>>>
>>>>>> In this world, all DAGRuns would have a "schedule_date" (the date
>>>>> this
>>>>>> would have normally started at), and an "execution_date" (when it was
>>>>>> actually executed). If a given DAGrun has a window (one-off DAGs may
>>>>> or may
>>>>>> not!), there would be variables for "window_start" (the start of the
>>>>>> window) and "window_end" (the end of the window; this would default
>>>>> to the
>>>>>> same as schedule_date, and to the next DAGrun's window_start).
>>>>>>
>>>>>> Disconnecting schedule date, execution date, and window/period would
>>>>> also
>>>>>> open a pathway for more advanced users to implement irregular
>>>>> schedules and
>>>>>> windows, without having to rely on hacks. For example: a DAG that
>>>>> runs at
>>>>>> "the end of the week" to produce a end-of-week would normally run on
>>>>>> Friday, but on Friday holidays, instead complete a day early (and
>>>>> scan one
>>>>>> fewer day in its window).
>>>>>>
>>>>>> I know there's some historical baggage here, but I think the above is
>>>>> much
>>>>>> more natural to new users than what we're offering today. And I think
>>>>> from
>>>>>> a current user perspective, there would be breaking variable name
>>>>> changes,
>>>>>> but no logical differences for the majority of DAGs.
>>>>>>
>>>>>> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
>>>>> wrote:
>>>>>>
>>>>>> To (slightly) hijack this thread:
>>>>>>
>>>>>> On the subject of execuction_date: as I'm sure we're all aware the
>>>>>> concept
>>>>>> of execution_date is confusing to new-commers to Airflow (there are
>>>>> many
>>>>>> questions about "why hasn't my DAG run yet"? "Why is my dag a day
>>>>>> behind?"
>>>>>> etc.) and although we mention this in the docs it's a confusing
>>>>> concept.
>>>>>>
>>>>>> What to people think about adding two new parameters: `period_start`
>>>>> and
>>>>>> `period_end` and making these the preferred terms in place of
>>>>>> execution_date and next_execution_date?
>>>>>>
>>>>>> This hopefully avoids any ambitious terms like "execution" or "run"
>>>>> which
>>>>>> is understandably easy to conflate with the time the task is being
>>>>> run
>>>>>> (i.e. `now()`)
>>>>>>
>>>>>> If people think this naming is better and less confusing I would
>>>>> suggest
>>>>>> we update all the docs and examples to use these terms (but still
>>>>> mention
>>>>>> the old names somewhere, probably in the macros docs)
>>>>>>
>>>>>> Thoughts?
>>>>>>
>>>>>> -ash
>>>>>>
>>>>>>
>>>>>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi Bas,
>>>>>>
>>>>>> 1) I am aware of a few places where those parameters are used in
>>>>>> production
>>>>>> in a few hundred jobs. I highly recommend we don't deprecate them
>>>>>> unless
>>>>>> we
>>>>>> do it in a major version.
>>>>>>
>>>>>> 2) As James mentioned, inlets and outlets are a lineage annotation
>>>>>> feature
>>>>>> which is still under development. Let's leave them in, but we can
>>>>> guard
>>>>>> them behind a feature flag if you prefer.
>>>>>>
>>>>>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
>>>>>> daily
>>>>>> ETL. I agree with you that they are simple to compute, but not
>>>>> everyone
>>>>>> using Apache Airflow is amazing with Python. Some users are only
>>>>> trying
>>>>>> to
>>>>>> get a query scheduled and rely on a couple of niceties like these to
>>>>>> get
>>>>>> by.
>>>>>>
>>>>>> 4) latest_date, end_date (I feel like there used to be start_date,
>>>>> but
>>>>>> maybe it got lost) were a blend of things which were used by a
>>>>> backfill
>>>>>> framework used internally at Airbnb. Latest date was used if you
>>>>> needed
>>>>>> to
>>>>>> join to a dimension for which you only wanted the latest version of
>>>>> the
>>>>>> attributes in you backfill. end_date was used for time ranges where
>>>>>> several
>>>>>> days were processed together in a range to save on compute. I don't
>>>>> see
>>>>>> an
>>>>>> issue with removing them.
>>>>>>
>>>>>> Best regards,
>>>>>> Arthur
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
>>>>>> basharenslak@godatadriven.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Following Tao Feng’s question to discuss this PR<
>>>>>> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
>>>>>> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
>>>>>> here
>>>>>> if you agree/disagree/would change.
>>>>>>
>>>>>> -----------
>>>>>>
>>>>>> The summary of the PR:
>>>>>>
>>>>>> I was confused by the task context values and suggest to clean up and
>>>>>> clarify these variables. Some are derivations from other variables,
>>>>>> some
>>>>>> are undocumented and unused, some are wrong (name doesn’t match the
>>>>>> value).
>>>>>> Please discuss what you think of the removal of these variables:
>>>>>>
>>>>>>
>>>>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
>>>>> useful
>>>>>> since these require complex logic to compute the next execution date,
>>>>>> however would leave computing the yesterday* and tomorrow* variables
>>>>>> up
>>>>>> to
>>>>>> the user since they are simple one-liners and don't relate to the DAG
>>>>>> interval.
>>>>>> * Removed tables. This is a field in params, and is thus also
>>>>>> accessible by the user ({{ params.tables }}). Also, it was
>>>>>> undocumented.
>>>>>> * Removed latest_date. It's the same as ds and was also
>>>>>> undocumented.
>>>>>> * Removed inlets and outlets. Also undocumented, and have the
>>>>>> inlets/outlets ever worked/ever been used by anybody?
>>>>>> * Removed end_date and END_DATE. Both have the same value, so it
>>>>>> doesn't make sense to have both variables. Also, the value is ds
>>>>> which
>>>>>> contains the start date of the interval, so the naming didn't make
>>>>>> sense to
>>>>>> me. However, if anybody argues in favour of adding "start_date" and
>>>>>> "end_date" to provide the start and end datetime of task instance
>>>>>> intervals, I'd be happy to add them.
>>>>>>
>>>>>> Cheers,
>>>>>> Bas
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Ash Berlin-Taylor <as...@apache.org>.
Does anyone actually use end_date (of either spelling) given it's value is currently the same as `ds`: https://github.com/apache/airflow/blob/3020d9733cb189f091489a62f58f0f586dc8d4a9/airflow/models/taskinstance.py#L1183-L1184
'END_DATE': ds,
'end_date': ds,
That seems like it is just the wrong value - I could see it being useful as either the same value as `next_execution_date` or `dag.end_date` but the current value (from a quick thought) doesn't seem like it is useful?
Given what the value is currently set to I vote for deprecating/removing these two.
> On 12 Apr 2019, at 09:39, Bolke de Bruin <bd...@gmail.com> wrote:
>
> I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
>
> End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
>
> Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
>
>
>
> Verstuurd vanaf mijn iPad
>
>> Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com> het volgende geschreven:
>>
>> It should be labelled as a "bridge" or "transition" release somehow, and
>> tell the community to absolutely to go there first and address all
>> deprecation warnings prior to upgrade to 2.0. I wonder if semver has
>> something for that.
>>
>> It might be the time to deprecate more things. Spring cleaning!
>>
>> Should we start another thread labeled "[2.0 spring cleaning] what Airflow
>> features should we deprecate!?"
>>
>> Max
>>
>>> On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org> wrote:
>>>
>>> I am happy to do another small(!) 1.10.x release.
>>>
>>> (There was a small bug I introduced where I broke the rendering of doc_md
>>> on dags)
>>>
>>> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>
>>> wrote:
>>>> I agree with Max here, we should be careful.
>>>>
>>>> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>> tomorrow_ds_nodash. I'm not against having better readable shorthands,
>>>> but
>>>> more about the fact that having a tomorrow_ds doesn't make sense when
>>>> we
>>>> have an hourly (or weekly) job.
>>>>
>>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>>> extra
>>>> logic, and this is not worth the added complexity (and another flag) in
>>>> my
>>>> opinion.
>>>>
>>>> - We start by putting deprecation warnings on tables, latest_date,
>>>> end_date
>>>> and END_DATE and remove them in Airflow 2.0.
>>>>
>>>> This is only possible if there is another version before 2.0.
>>>> Currently,
>>>> we're preparing to move to 2.0
>>>>
>>>> - We add a lineage_enabled config which is false by default and thus
>>>> inlets/outlets aren’t provided, unless set to true.
>>>>
>>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>>> extra
>>>> logic, and this is not worth the added complexity (and another flag) in
>>>> my
>>>> opinion.
>>>>
>>>> - We continue discussion about clarification of execution_date and
>>>> better
>>>> named variables such as something_start and something_end
>>>>
>>>>
>>> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>>>>
>>>> Cheers, Fokko
>>>>
>>>> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
>>>> basharenslak@godatadriven.com>:
>>>>
>>>>> Great discussion, let’s stay on track. If I can summarise:
>>>>>
>>>>>
>>>>> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>> tomorrow_ds_nodash
>>>>> * Arthur: some users use these for convenience
>>>>> * Bas/Fokko: these are values that can be easily derived in a
>>>>> one-liner
>>>>>
>>>>> * tables
>>>>> * nobody?
>>>>>
>>>>> * latest_date
>>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>>> no
>>>>> issue removing them.
>>>>>
>>>>> * inlets/outlets
>>>>> * Arthur: still in development, could be guarded behind
>>>> feature
>>>>> flag.
>>>>>
>>>>> * end_date/END_DATE
>>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>>> no
>>>>> issue removing them.
>>>>>
>>>>> And to add to the discussion:
>>>>>
>>>>>
>>>>> * execution_date
>>>>> * The meaning of execution_date is ambivalent and super
>>>> confusing
>>>>> to everybody because it’s not the date of execution.
>>>>> * Suggestions to add period_start/period_end, or
>>>>> interval_start/interval_end, or something like that, to provide
>>>> datetime
>>>>> variables for start & end datetime of a DAG run.
>>>>> * Other:
>>>>> * Removal of variables should be done in major version and
>>>>> deprecation warnings should be added.
>>>>>
>>>>> So how about the following:
>>>>> - We start by putting deprecation warnings on tables, latest_date,
>>>>> end_date and END_DATE and remove them in Airflow 2.0.
>>>>> - We add a lineage_enabled config which is false by default and thus
>>>>> inlets/outlets aren’t provided, unless set to true.
>>>>> - We continue discussion about yesterday* and tomorrow*
>>>>> - We continue discussion about clarification of execution_date and
>>>> better
>>>>> named variables such as something_start and something_end
>>>>>
>>>>> Cheers,
>>>>> Bas
>>>>>
>>>>>
>>>>> On 11 Apr 2019, at 04:52, Maxime Beauchemin
>>>> <maximebeauchemin@gmail.com
>>>>> <ma...@gmail.com>> wrote:
>>>>>
>>>>> Making backwards incompatible changes that require altering the
>>>> thousands
>>>>> (millions?!) of DAGs in the wild will alienate the community and
>>>> prevent
>>>>> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
>>>> Airflow
>>>>> atomically would be hard and dangerous.
>>>>>
>>>>> To mitigate this, changes to the DAG / core API should be backward
>>>>> compatible, at least for a release range, and alert on upcoming
>>>> deprecation
>>>>> (if needed)
>>>>>
>>>>> To be clear if `execution_date` is renamed to `foo`, we should have a
>>>>> version range where both work just as well, but using
>>>> `execution_date`
>>>>> would result is warning messages about its upcoming deprecation,
>>>> maybe
>>>>> something like "It appears you're using the task parameter
>>>> `execution_date`
>>>>> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
>>>> find
>>>>> more info at link.to/foo<http://link.to/foo>"
>>>>>
>>>>> Max
>>>>>
>>>>> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>>>>>
>>>> <jm...@quantopian.com.invalid>>
>>>>> wrote:
>>>>>
>>>>> I agree with Ash here. The naming of "execution_date" is incredibly
>>>>> confusing to people who are new to Airflow, who think it has
>>>> something to
>>>>> do with... execution.
>>>>>
>>>>> However, I think that there's still room for improvement with
>>>>> "period_start" and "period_end". Think about manually triggered tasks
>>>> -
>>>>> they'd have a "period_start", but no useful "period_end" until the
>>>> next
>>>>> trigger occurs. And mid-day ETL tasks that are dated to "today" still
>>>> have
>>>>> to reference "period_end" to get the correct date, even though the
>>>> DAGrun
>>>>> won't be over yet!
>>>>>
>>>>> If we're going to go through and rename "execution_date", I'd rather
>>>> see a
>>>>> wider-ranging rework that understands a mapping from a date to a
>>>> window
>>>>> (like "every day, process the data from one week ago", or "every
>>>> Saturday,
>>>>> process today's data"). Maybe something closer to how Beam does it
>>>>> (but retaining simplicity for the 99% of cases that are just "run
>>>> daily,
>>>>> for the past day").
>>>>>
>>>>>
>>>>>
>>>>
>>> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>>>>>
>>>>> I could see something where there are two default DAG parameters are:
>>>>> schedule="@daily"
>>>>> window=-1 (or some schedule_delta object that provides a windowing
>>>> impl, or
>>>>> None if there is no window)
>>>>>
>>>>> In this world, all DAGRuns would have a "schedule_date" (the date
>>>> this
>>>>> would have normally started at), and an "execution_date" (when it was
>>>>> actually executed). If a given DAGrun has a window (one-off DAGs may
>>>> or may
>>>>> not!), there would be variables for "window_start" (the start of the
>>>>> window) and "window_end" (the end of the window; this would default
>>>> to the
>>>>> same as schedule_date, and to the next DAGrun's window_start).
>>>>>
>>>>> Disconnecting schedule date, execution date, and window/period would
>>>> also
>>>>> open a pathway for more advanced users to implement irregular
>>>> schedules and
>>>>> windows, without having to rely on hacks. For example: a DAG that
>>>> runs at
>>>>> "the end of the week" to produce a end-of-week would normally run on
>>>>> Friday, but on Friday holidays, instead complete a day early (and
>>>> scan one
>>>>> fewer day in its window).
>>>>>
>>>>> I know there's some historical baggage here, but I think the above is
>>>> much
>>>>> more natural to new users than what we're offering today. And I think
>>>> from
>>>>> a current user perspective, there would be breaking variable name
>>>> changes,
>>>>> but no logical differences for the majority of DAGs.
>>>>>
>>>>> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
>>>> wrote:
>>>>>
>>>>> To (slightly) hijack this thread:
>>>>>
>>>>> On the subject of execuction_date: as I'm sure we're all aware the
>>>>> concept
>>>>> of execution_date is confusing to new-commers to Airflow (there are
>>>> many
>>>>> questions about "why hasn't my DAG run yet"? "Why is my dag a day
>>>>> behind?"
>>>>> etc.) and although we mention this in the docs it's a confusing
>>>> concept.
>>>>>
>>>>> What to people think about adding two new parameters: `period_start`
>>>> and
>>>>> `period_end` and making these the preferred terms in place of
>>>>> execution_date and next_execution_date?
>>>>>
>>>>> This hopefully avoids any ambitious terms like "execution" or "run"
>>>> which
>>>>> is understandably easy to conflate with the time the task is being
>>>> run
>>>>> (i.e. `now()`)
>>>>>
>>>>> If people think this naming is better and less confusing I would
>>>> suggest
>>>>> we update all the docs and examples to use these terms (but still
>>>> mention
>>>>> the old names somewhere, probably in the macros docs)
>>>>>
>>>>> Thoughts?
>>>>>
>>>>> -ash
>>>>>
>>>>>
>>>>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi Bas,
>>>>>
>>>>> 1) I am aware of a few places where those parameters are used in
>>>>> production
>>>>> in a few hundred jobs. I highly recommend we don't deprecate them
>>>>> unless
>>>>> we
>>>>> do it in a major version.
>>>>>
>>>>> 2) As James mentioned, inlets and outlets are a lineage annotation
>>>>> feature
>>>>> which is still under development. Let's leave them in, but we can
>>>> guard
>>>>> them behind a feature flag if you prefer.
>>>>>
>>>>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
>>>>> daily
>>>>> ETL. I agree with you that they are simple to compute, but not
>>>> everyone
>>>>> using Apache Airflow is amazing with Python. Some users are only
>>>> trying
>>>>> to
>>>>> get a query scheduled and rely on a couple of niceties like these to
>>>>> get
>>>>> by.
>>>>>
>>>>> 4) latest_date, end_date (I feel like there used to be start_date,
>>>> but
>>>>> maybe it got lost) were a blend of things which were used by a
>>>> backfill
>>>>> framework used internally at Airbnb. Latest date was used if you
>>>> needed
>>>>> to
>>>>> join to a dimension for which you only wanted the latest version of
>>>> the
>>>>> attributes in you backfill. end_date was used for time ranges where
>>>>> several
>>>>> days were processed together in a range to save on compute. I don't
>>>> see
>>>>> an
>>>>> issue with removing them.
>>>>>
>>>>> Best regards,
>>>>> Arthur
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
>>>>> basharenslak@godatadriven.com>
>>>>> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> Following Tao Feng’s question to discuss this PR<
>>>>> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
>>>>> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
>>>>> here
>>>>> if you agree/disagree/would change.
>>>>>
>>>>> -----------
>>>>>
>>>>> The summary of the PR:
>>>>>
>>>>> I was confused by the task context values and suggest to clean up and
>>>>> clarify these variables. Some are derivations from other variables,
>>>>> some
>>>>> are undocumented and unused, some are wrong (name doesn’t match the
>>>>> value).
>>>>> Please discuss what you think of the removal of these variables:
>>>>>
>>>>>
>>>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
>>>> useful
>>>>> since these require complex logic to compute the next execution date,
>>>>> however would leave computing the yesterday* and tomorrow* variables
>>>>> up
>>>>> to
>>>>> the user since they are simple one-liners and don't relate to the DAG
>>>>> interval.
>>>>> * Removed tables. This is a field in params, and is thus also
>>>>> accessible by the user ({{ params.tables }}). Also, it was
>>>>> undocumented.
>>>>> * Removed latest_date. It's the same as ds and was also
>>>>> undocumented.
>>>>> * Removed inlets and outlets. Also undocumented, and have the
>>>>> inlets/outlets ever worked/ever been used by anybody?
>>>>> * Removed end_date and END_DATE. Both have the same value, so it
>>>>> doesn't make sense to have both variables. Also, the value is ds
>>>> which
>>>>> contains the start date of the interval, so the naming didn't make
>>>>> sense to
>>>>> me. However, if anybody argues in favour of adding "start_date" and
>>>>> "end_date" to provide the start and end datetime of task instance
>>>>> intervals, I'd be happy to add them.
>>>>>
>>>>> Cheers,
>>>>> Bas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task context variables
Posted by Bolke de Bruin <bd...@gmail.com>.
Okay
Yes inlets and outlets will be picked up again. I expect somewhere this quarter.
Sent from my iPhone
> On 12 Apr 2019, at 11:06, Bas Harenslak <ba...@godatadriven.com> wrote:
>
> Reason for deprecating end_date is it is incorrect since the name does not match the value, it’s currently the same as ds (the start datetime of the interval).
>
> Another option would be to keep it but set the value to the end date of the interval, although I think that would create even more confusion.
>
> I’m aware that execution_date is used by practically all Airflow users so wouldn’t deprecate that. However adding new, clearly named variables is what I’d do to remove the discussion and confusion around execution_date.
>
> And last: are the inlets/outlets still in development?
>
> Bas
>
>
> On 12 Apr 2019, at 10:39, Bolke de Bruin <bd...@gmail.com>> wrote:
>
> I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
>
> End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
>
> Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
>
>
>
> Verstuurd vanaf mijn iPad
>
> Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com>> het volgende geschreven:
>
> It should be labelled as a "bridge" or "transition" release somehow, and
> tell the community to absolutely to go there first and address all
> deprecation warnings prior to upgrade to 2.0. I wonder if semver has
> something for that.
>
> It might be the time to deprecate more things. Spring cleaning!
>
> Should we start another thread labeled "[2.0 spring cleaning] what Airflow
> features should we deprecate!?"
>
> Max
>
> On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org>> wrote:
>
> I am happy to do another small(!) 1.10.x release.
>
> (There was a small bug I introduced where I broke the rendering of doc_md
> on dags)
>
> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>>
> wrote:
> I agree with Max here, we should be careful.
>
> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. I'm not against having better readable shorthands,
> but
> more about the fact that having a tomorrow_ds doesn't make sense when
> we
> have an hourly (or weekly) job.
>
> I'm against guarding the {in,out}lets. Since the guarding will add
> extra
> logic, and this is not worth the added complexity (and another flag) in
> my
> opinion.
>
> - We start by putting deprecation warnings on tables, latest_date,
> end_date
> and END_DATE and remove them in Airflow 2.0.
>
> This is only possible if there is another version before 2.0.
> Currently,
> we're preparing to move to 2.0
>
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
>
> I'm against guarding the {in,out}lets. Since the guarding will add
> extra
> logic, and this is not worth the added complexity (and another flag) in
> my
> opinion.
>
> - We continue discussion about clarification of execution_date and
> better
> named variables such as something_start and something_end
>
>
> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>
> Cheers, Fokko
>
> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
> basharenslak@godatadriven.com>:
>
> Great discussion, let’s stay on track. If I can summarise:
>
>
> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash
> * Arthur: some users use these for convenience
> * Bas/Fokko: these are values that can be easily derived in a
> one-liner
>
> * tables
> * nobody?
>
> * latest_date
> * Arthur: used by internal backfill framework at Airbnb, but
> no
> issue removing them.
>
> * inlets/outlets
> * Arthur: still in development, could be guarded behind
> feature
> flag.
>
> * end_date/END_DATE
> * Arthur: used by internal backfill framework at Airbnb, but
> no
> issue removing them.
>
> And to add to the discussion:
>
>
> * execution_date
> * The meaning of execution_date is ambivalent and super
> confusing
> to everybody because it’s not the date of execution.
> * Suggestions to add period_start/period_end, or
> interval_start/interval_end, or something like that, to provide
> datetime
> variables for start & end datetime of a DAG run.
> * Other:
> * Removal of variables should be done in major version and
> deprecation warnings should be added.
>
> So how about the following:
> - We start by putting deprecation warnings on tables, latest_date,
> end_date and END_DATE and remove them in Airflow 2.0.
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
> - We continue discussion about yesterday* and tomorrow*
> - We continue discussion about clarification of execution_date and
> better
> named variables such as something_start and something_end
>
> Cheers,
> Bas
>
>
> On 11 Apr 2019, at 04:52, Maxime Beauchemin
> <maximebeauchemin@gmail.com
> <ma...@gmail.com>> wrote:
>
> Making backwards incompatible changes that require altering the
> thousands
> (millions?!) of DAGs in the wild will alienate the community and
> prevent
> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
> Airflow
> atomically would be hard and dangerous.
>
> To mitigate this, changes to the DAG / core API should be backward
> compatible, at least for a release range, and alert on upcoming
> deprecation
> (if needed)
>
> To be clear if `execution_date` is renamed to `foo`, we should have a
> version range where both work just as well, but using
> `execution_date`
> would result is warning messages about its upcoming deprecation,
> maybe
> something like "It appears you're using the task parameter
> `execution_date`
> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
> find
> more info at link.to/foo<http://link.to/foo>"
>
> Max
>
> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>
> <jm...@quantopian.com.invalid>>
> wrote:
>
> I agree with Ash here. The naming of "execution_date" is incredibly
> confusing to people who are new to Airflow, who think it has
> something to
> do with... execution.
>
> However, I think that there's still room for improvement with
> "period_start" and "period_end". Think about manually triggered tasks
> -
> they'd have a "period_start", but no useful "period_end" until the
> next
> trigger occurs. And mid-day ETL tasks that are dated to "today" still
> have
> to reference "period_end" to get the correct date, even though the
> DAGrun
> won't be over yet!
>
> If we're going to go through and rename "execution_date", I'd rather
> see a
> wider-ranging rework that understands a mapping from a date to a
> window
> (like "every day, process the data from one week ago", or "every
> Saturday,
> process today's data"). Maybe something closer to how Beam does it
> (but retaining simplicity for the 99% of cases that are just "run
> daily,
> for the past day").
>
>
>
>
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>
> I could see something where there are two default DAG parameters are:
> schedule="@daily"
> window=-1 (or some schedule_delta object that provides a windowing
> impl, or
> None if there is no window)
>
> In this world, all DAGRuns would have a "schedule_date" (the date
> this
> would have normally started at), and an "execution_date" (when it was
> actually executed). If a given DAGrun has a window (one-off DAGs may
> or may
> not!), there would be variables for "window_start" (the start of the
> window) and "window_end" (the end of the window; this would default
> to the
> same as schedule_date, and to the next DAGrun's window_start).
>
> Disconnecting schedule date, execution date, and window/period would
> also
> open a pathway for more advanced users to implement irregular
> schedules and
> windows, without having to rely on hacks. For example: a DAG that
> runs at
> "the end of the week" to produce a end-of-week would normally run on
> Friday, but on Friday holidays, instead complete a day early (and
> scan one
> fewer day in its window).
>
> I know there's some historical baggage here, but I think the above is
> much
> more natural to new users than what we're offering today. And I think
> from
> a current user perspective, there would be breaking variable name
> changes,
> but no logical differences for the majority of DAGs.
>
> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
> wrote:
>
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the
> concept
> of execution_date is confusing to new-commers to Airflow (there are
> many
> questions about "why hasn't my DAG run yet"? "Why is my dag a day
> behind?"
> etc.) and although we mention this in the docs it's a confusing
> concept.
>
> What to people think about adding two new parameters: `period_start`
> and
> `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run"
> which
> is understandably easy to conflate with the time the task is being
> run
> (i.e. `now()`)
>
> If people think this naming is better and less confusing I would
> suggest
> we update all the docs and examples to use these terms (but still
> mention
> the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> wrote:
>
> Hi Bas,
>
> 1) I am aware of a few places where those parameters are used in
> production
> in a few hundred jobs. I highly recommend we don't deprecate them
> unless
> we
> do it in a major version.
>
> 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> which is still under development. Let's leave them in, but we can
> guard
> them behind a feature flag if you prefer.
>
> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> ETL. I agree with you that they are simple to compute, but not
> everyone
> using Apache Airflow is amazing with Python. Some users are only
> trying
> to
> get a query scheduled and rely on a couple of niceties like these to
> get
> by.
>
> 4) latest_date, end_date (I feel like there used to be start_date,
> but
> maybe it got lost) were a blend of things which were used by a
> backfill
> framework used internally at Airbnb. Latest date was used if you
> needed
> to
> join to a dimension for which you only wanted the latest version of
> the
> attributes in you backfill. end_date was used for time ranges where
> several
> days were processed together in a range to save on compute. I don't
> see
> an
> issue with removing them.
>
> Best regards,
> Arthur
>
>
>
> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com>
> wrote:
>
> Hi all,
>
> Following Tao Feng’s question to discuss this PR<
> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> here
> if you agree/disagree/would change.
>
> -----------
>
> The summary of the PR:
>
> I was confused by the task context values and suggest to clean up and
> clarify these variables. Some are derivations from other variables,
> some
> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> Please discuss what you think of the removal of these variables:
>
>
> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> useful
> since these require complex logic to compute the next execution date,
> however would leave computing the yesterday* and tomorrow* variables
> up
> to
> the user since they are simple one-liners and don't relate to the DAG
> interval.
> * Removed tables. This is a field in params, and is thus also
> accessible by the user ({{ params.tables }}). Also, it was
> undocumented.
> * Removed latest_date. It's the same as ds and was also
> undocumented.
> * Removed inlets and outlets. Also undocumented, and have the
> inlets/outlets ever worked/ever been used by anybody?
> * Removed end_date and END_DATE. Both have the same value, so it
> doesn't make sense to have both variables. Also, the value is ds
> which
> contains the start date of the interval, so the naming didn't make
> sense to
> me. However, if anybody argues in favour of adding "start_date" and
> "end_date" to provide the start and end datetime of task instance
> intervals, I'd be happy to add them.
>
> Cheers,
> Bas
>
>
>
>
>
>
>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Bas Harenslak <ba...@godatadriven.com>.
Reason for deprecating end_date is it is incorrect since the name does not match the value, it’s currently the same as ds (the start datetime of the interval).
Another option would be to keep it but set the value to the end date of the interval, although I think that would create even more confusion.
I’m aware that execution_date is used by practically all Airflow users so wouldn’t deprecate that. However adding new, clearly named variables is what I’d do to remove the discussion and confusion around execution_date.
And last: are the inlets/outlets still in development?
Bas
On 12 Apr 2019, at 10:39, Bolke de Bruin <bd...@gmail.com>> wrote:
I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
Verstuurd vanaf mijn iPad
Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com>> het volgende geschreven:
It should be labelled as a "bridge" or "transition" release somehow, and
tell the community to absolutely to go there first and address all
deprecation warnings prior to upgrade to 2.0. I wonder if semver has
something for that.
It might be the time to deprecate more things. Spring cleaning!
Should we start another thread labeled "[2.0 spring cleaning] what Airflow
features should we deprecate!?"
Max
On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org>> wrote:
I am happy to do another small(!) 1.10.x release.
(There was a small bug I introduced where I broke the rendering of doc_md
on dags)
On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>>
wrote:
I agree with Max here, we should be careful.
Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. I'm not against having better readable shorthands,
but
more about the fact that having a tomorrow_ds doesn't make sense when
we
have an hourly (or weekly) job.
I'm against guarding the {in,out}lets. Since the guarding will add
extra
logic, and this is not worth the added complexity (and another flag) in
my
opinion.
- We start by putting deprecation warnings on tables, latest_date,
end_date
and END_DATE and remove them in Airflow 2.0.
This is only possible if there is another version before 2.0.
Currently,
we're preparing to move to 2.0
- We add a lineage_enabled config which is false by default and thus
inlets/outlets aren’t provided, unless set to true.
I'm against guarding the {in,out}lets. Since the guarding will add
extra
logic, and this is not worth the added complexity (and another flag) in
my
opinion.
- We continue discussion about clarification of execution_date and
better
named variables such as something_start and something_end
https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
Cheers, Fokko
Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
basharenslak@godatadriven.com>:
Great discussion, let’s stay on track. If I can summarise:
* yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash
* Arthur: some users use these for convenience
* Bas/Fokko: these are values that can be easily derived in a
one-liner
* tables
* nobody?
* latest_date
* Arthur: used by internal backfill framework at Airbnb, but
no
issue removing them.
* inlets/outlets
* Arthur: still in development, could be guarded behind
feature
flag.
* end_date/END_DATE
* Arthur: used by internal backfill framework at Airbnb, but
no
issue removing them.
And to add to the discussion:
* execution_date
* The meaning of execution_date is ambivalent and super
confusing
to everybody because it’s not the date of execution.
* Suggestions to add period_start/period_end, or
interval_start/interval_end, or something like that, to provide
datetime
variables for start & end datetime of a DAG run.
* Other:
* Removal of variables should be done in major version and
deprecation warnings should be added.
So how about the following:
- We start by putting deprecation warnings on tables, latest_date,
end_date and END_DATE and remove them in Airflow 2.0.
- We add a lineage_enabled config which is false by default and thus
inlets/outlets aren’t provided, unless set to true.
- We continue discussion about yesterday* and tomorrow*
- We continue discussion about clarification of execution_date and
better
named variables such as something_start and something_end
Cheers,
Bas
On 11 Apr 2019, at 04:52, Maxime Beauchemin
<maximebeauchemin@gmail.com
<ma...@gmail.com>> wrote:
Making backwards incompatible changes that require altering the
thousands
(millions?!) of DAGs in the wild will alienate the community and
prevent
many from orchestrating an upgrade. Upgrading hundreds of DAGs and
Airflow
atomically would be hard and dangerous.
To mitigate this, changes to the DAG / core API should be backward
compatible, at least for a release range, and alert on upcoming
deprecation
(if needed)
To be clear if `execution_date` is renamed to `foo`, we should have a
version range where both work just as well, but using
`execution_date`
would result is warning messages about its upcoming deprecation,
maybe
something like "It appears you're using the task parameter
`execution_date`
which will be deprecated in favor or `foo` in upcoming release 2.0.0,
find
more info at link.to/foo<http://link.to/foo>"
Max
On Tue, Apr 9, 2019 at 7:58 AM James Meickle
<jm...@quantopian.com.invalid>>
wrote:
I agree with Ash here. The naming of "execution_date" is incredibly
confusing to people who are new to Airflow, who think it has
something to
do with... execution.
However, I think that there's still room for improvement with
"period_start" and "period_end". Think about manually triggered tasks
-
they'd have a "period_start", but no useful "period_end" until the
next
trigger occurs. And mid-day ETL tasks that are dated to "today" still
have
to reference "period_end" to get the correct date, even though the
DAGrun
won't be over yet!
If we're going to go through and rename "execution_date", I'd rather
see a
wider-ranging rework that understands a mapping from a date to a
window
(like "every day, process the data from one week ago", or "every
Saturday,
process today's data"). Maybe something closer to how Beam does it
(but retaining simplicity for the 99% of cases that are just "run
daily,
for the past day").
https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
I could see something where there are two default DAG parameters are:
schedule="@daily"
window=-1 (or some schedule_delta object that provides a windowing
impl, or
None if there is no window)
In this world, all DAGRuns would have a "schedule_date" (the date
this
would have normally started at), and an "execution_date" (when it was
actually executed). If a given DAGrun has a window (one-off DAGs may
or may
not!), there would be variables for "window_start" (the start of the
window) and "window_end" (the end of the window; this would default
to the
same as schedule_date, and to the next DAGrun's window_start).
Disconnecting schedule date, execution date, and window/period would
also
open a pathway for more advanced users to implement irregular
schedules and
windows, without having to rely on hacks. For example: a DAG that
runs at
"the end of the week" to produce a end-of-week would normally run on
Friday, but on Friday holidays, instead complete a day early (and
scan one
fewer day in its window).
I know there's some historical baggage here, but I think the above is
much
more natural to new users than what we're offering today. And I think
from
a current user perspective, there would be breaking variable name
changes,
but no logical differences for the majority of DAGs.
On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
wrote:
To (slightly) hijack this thread:
On the subject of execuction_date: as I'm sure we're all aware the
concept
of execution_date is confusing to new-commers to Airflow (there are
many
questions about "why hasn't my DAG run yet"? "Why is my dag a day
behind?"
etc.) and although we mention this in the docs it's a confusing
concept.
What to people think about adding two new parameters: `period_start`
and
`period_end` and making these the preferred terms in place of
execution_date and next_execution_date?
This hopefully avoids any ambitious terms like "execution" or "run"
which
is understandably easy to conflate with the time the task is being
run
(i.e. `now()`)
If people think this naming is better and less confusing I would
suggest
we update all the docs and examples to use these terms (but still
mention
the old names somewhere, probably in the macros docs)
Thoughts?
-ash
On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
wrote:
Hi Bas,
1) I am aware of a few places where those parameters are used in
production
in a few hundred jobs. I highly recommend we don't deprecate them
unless
we
do it in a major version.
2) As James mentioned, inlets and outlets are a lineage annotation
feature
which is still under development. Let's leave them in, but we can
guard
them behind a feature flag if you prefer.
3) the yesterday*/tomorrow* params are convenience ones if you use a
daily
ETL. I agree with you that they are simple to compute, but not
everyone
using Apache Airflow is amazing with Python. Some users are only
trying
to
get a query scheduled and rely on a couple of niceties like these to
get
by.
4) latest_date, end_date (I feel like there used to be start_date,
but
maybe it got lost) were a blend of things which were used by a
backfill
framework used internally at Airbnb. Latest date was used if you
needed
to
join to a dimension for which you only wanted the latest version of
the
attributes in you backfill. end_date was used for time ranges where
several
days were processed together in a range to save on compute. I don't
see
an
issue with removing them.
Best regards,
Arthur
On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
basharenslak@godatadriven.com>
wrote:
Hi all,
Following Tao Feng’s question to discuss this PR<
https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
here
if you agree/disagree/would change.
-----------
The summary of the PR:
I was confused by the task context values and suggest to clean up and
clarify these variables. Some are derivations from other variables,
some
are undocumented and unused, some are wrong (name doesn’t match the
value).
Please discuss what you think of the removal of these variables:
* Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. IMO the next_* and previous_* variables are
useful
since these require complex logic to compute the next execution date,
however would leave computing the yesterday* and tomorrow* variables
up
to
the user since they are simple one-liners and don't relate to the DAG
interval.
* Removed tables. This is a field in params, and is thus also
accessible by the user ({{ params.tables }}). Also, it was
undocumented.
* Removed latest_date. It's the same as ds and was also
undocumented.
* Removed inlets and outlets. Also undocumented, and have the
inlets/outlets ever worked/ever been used by anybody?
* Removed end_date and END_DATE. Both have the same value, so it
doesn't make sense to have both variables. Also, the value is ds
which
contains the start date of the interval, so the naming didn't make
sense to
me. However, if anybody argues in favour of adding "start_date" and
"end_date" to provide the start and end datetime of task instance
intervals, I'd be happy to add them.
Cheers,
Bas
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task context variables
Posted by Bolke de Bruin <bd...@gmail.com>.
I don’t think guarding inlets and outlets makes sense, cause if they are not defined they code won’t be executed anyway. Ie. The logic is already there, no need for a config flag.
End-date is actually used by some beyond Airbnb as far as I know. What is the reason for deprecating it?
Execution_date in finance is actually very well known. A transaction has an execution date it is not the time of the sending of the data. I honestly think that a change here would make it a thing that techies understand but does not make business sense. What is “today’s data?” it might not be the data that was sent today.
Verstuurd vanaf mijn iPad
> Op 12 apr. 2019 om 08:35 heeft Maxime Beauchemin <ma...@gmail.com> het volgende geschreven:
>
> It should be labelled as a "bridge" or "transition" release somehow, and
> tell the community to absolutely to go there first and address all
> deprecation warnings prior to upgrade to 2.0. I wonder if semver has
> something for that.
>
> It might be the time to deprecate more things. Spring cleaning!
>
> Should we start another thread labeled "[2.0 spring cleaning] what Airflow
> features should we deprecate!?"
>
> Max
>
>> On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org> wrote:
>>
>> I am happy to do another small(!) 1.10.x release.
>>
>> (There was a small bug I introduced where I broke the rendering of doc_md
>> on dags)
>>
>> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>
>> wrote:
>>> I agree with Max here, we should be careful.
>>>
>>> Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>> tomorrow_ds_nodash. I'm not against having better readable shorthands,
>>> but
>>> more about the fact that having a tomorrow_ds doesn't make sense when
>>> we
>>> have an hourly (or weekly) job.
>>>
>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>> extra
>>> logic, and this is not worth the added complexity (and another flag) in
>>> my
>>> opinion.
>>>
>>> - We start by putting deprecation warnings on tables, latest_date,
>>> end_date
>>> and END_DATE and remove them in Airflow 2.0.
>>>
>>> This is only possible if there is another version before 2.0.
>>> Currently,
>>> we're preparing to move to 2.0
>>>
>>> - We add a lineage_enabled config which is false by default and thus
>>> inlets/outlets aren’t provided, unless set to true.
>>>
>>> I'm against guarding the {in,out}lets. Since the guarding will add
>>> extra
>>> logic, and this is not worth the added complexity (and another flag) in
>>> my
>>> opinion.
>>>
>>> - We continue discussion about clarification of execution_date and
>>> better
>>> named variables such as something_start and something_end
>>>
>>>
>> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>>>
>>> Cheers, Fokko
>>>
>>> Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
>>> basharenslak@godatadriven.com>:
>>>
>>>> Great discussion, let’s stay on track. If I can summarise:
>>>>
>>>>
>>>> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>> tomorrow_ds_nodash
>>>> * Arthur: some users use these for convenience
>>>> * Bas/Fokko: these are values that can be easily derived in a
>>>> one-liner
>>>>
>>>> * tables
>>>> * nobody?
>>>>
>>>> * latest_date
>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>> no
>>>> issue removing them.
>>>>
>>>> * inlets/outlets
>>>> * Arthur: still in development, could be guarded behind
>>> feature
>>>> flag.
>>>>
>>>> * end_date/END_DATE
>>>> * Arthur: used by internal backfill framework at Airbnb, but
>>> no
>>>> issue removing them.
>>>>
>>>> And to add to the discussion:
>>>>
>>>>
>>>> * execution_date
>>>> * The meaning of execution_date is ambivalent and super
>>> confusing
>>>> to everybody because it’s not the date of execution.
>>>> * Suggestions to add period_start/period_end, or
>>>> interval_start/interval_end, or something like that, to provide
>>> datetime
>>>> variables for start & end datetime of a DAG run.
>>>> * Other:
>>>> * Removal of variables should be done in major version and
>>>> deprecation warnings should be added.
>>>>
>>>> So how about the following:
>>>> - We start by putting deprecation warnings on tables, latest_date,
>>>> end_date and END_DATE and remove them in Airflow 2.0.
>>>> - We add a lineage_enabled config which is false by default and thus
>>>> inlets/outlets aren’t provided, unless set to true.
>>>> - We continue discussion about yesterday* and tomorrow*
>>>> - We continue discussion about clarification of execution_date and
>>> better
>>>> named variables such as something_start and something_end
>>>>
>>>> Cheers,
>>>> Bas
>>>>
>>>>
>>>> On 11 Apr 2019, at 04:52, Maxime Beauchemin
>>> <maximebeauchemin@gmail.com
>>>> <ma...@gmail.com>> wrote:
>>>>
>>>> Making backwards incompatible changes that require altering the
>>> thousands
>>>> (millions?!) of DAGs in the wild will alienate the community and
>>> prevent
>>>> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
>>> Airflow
>>>> atomically would be hard and dangerous.
>>>>
>>>> To mitigate this, changes to the DAG / core API should be backward
>>>> compatible, at least for a release range, and alert on upcoming
>>> deprecation
>>>> (if needed)
>>>>
>>>> To be clear if `execution_date` is renamed to `foo`, we should have a
>>>> version range where both work just as well, but using
>>> `execution_date`
>>>> would result is warning messages about its upcoming deprecation,
>>> maybe
>>>> something like "It appears you're using the task parameter
>>> `execution_date`
>>>> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
>>> find
>>>> more info at link.to/foo<http://link.to/foo>"
>>>>
>>>> Max
>>>>
>>>> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>>>>
>>> <jm...@quantopian.com.invalid>>
>>>> wrote:
>>>>
>>>> I agree with Ash here. The naming of "execution_date" is incredibly
>>>> confusing to people who are new to Airflow, who think it has
>>> something to
>>>> do with... execution.
>>>>
>>>> However, I think that there's still room for improvement with
>>>> "period_start" and "period_end". Think about manually triggered tasks
>>> -
>>>> they'd have a "period_start", but no useful "period_end" until the
>>> next
>>>> trigger occurs. And mid-day ETL tasks that are dated to "today" still
>>> have
>>>> to reference "period_end" to get the correct date, even though the
>>> DAGrun
>>>> won't be over yet!
>>>>
>>>> If we're going to go through and rename "execution_date", I'd rather
>>> see a
>>>> wider-ranging rework that understands a mapping from a date to a
>>> window
>>>> (like "every day, process the data from one week ago", or "every
>>> Saturday,
>>>> process today's data"). Maybe something closer to how Beam does it
>>>> (but retaining simplicity for the 99% of cases that are just "run
>>> daily,
>>>> for the past day").
>>>>
>>>>
>>>>
>>>
>> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>>>>
>>>> I could see something where there are two default DAG parameters are:
>>>> schedule="@daily"
>>>> window=-1 (or some schedule_delta object that provides a windowing
>>> impl, or
>>>> None if there is no window)
>>>>
>>>> In this world, all DAGRuns would have a "schedule_date" (the date
>>> this
>>>> would have normally started at), and an "execution_date" (when it was
>>>> actually executed). If a given DAGrun has a window (one-off DAGs may
>>> or may
>>>> not!), there would be variables for "window_start" (the start of the
>>>> window) and "window_end" (the end of the window; this would default
>>> to the
>>>> same as schedule_date, and to the next DAGrun's window_start).
>>>>
>>>> Disconnecting schedule date, execution date, and window/period would
>>> also
>>>> open a pathway for more advanced users to implement irregular
>>> schedules and
>>>> windows, without having to rely on hacks. For example: a DAG that
>>> runs at
>>>> "the end of the week" to produce a end-of-week would normally run on
>>>> Friday, but on Friday holidays, instead complete a day early (and
>>> scan one
>>>> fewer day in its window).
>>>>
>>>> I know there's some historical baggage here, but I think the above is
>>> much
>>>> more natural to new users than what we're offering today. And I think
>>> from
>>>> a current user perspective, there would be breaking variable name
>>> changes,
>>>> but no logical differences for the majority of DAGs.
>>>>
>>>> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
>>> wrote:
>>>>
>>>> To (slightly) hijack this thread:
>>>>
>>>> On the subject of execuction_date: as I'm sure we're all aware the
>>>> concept
>>>> of execution_date is confusing to new-commers to Airflow (there are
>>> many
>>>> questions about "why hasn't my DAG run yet"? "Why is my dag a day
>>>> behind?"
>>>> etc.) and although we mention this in the docs it's a confusing
>>> concept.
>>>>
>>>> What to people think about adding two new parameters: `period_start`
>>> and
>>>> `period_end` and making these the preferred terms in place of
>>>> execution_date and next_execution_date?
>>>>
>>>> This hopefully avoids any ambitious terms like "execution" or "run"
>>> which
>>>> is understandably easy to conflate with the time the task is being
>>> run
>>>> (i.e. `now()`)
>>>>
>>>> If people think this naming is better and less confusing I would
>>> suggest
>>>> we update all the docs and examples to use these terms (but still
>>> mention
>>>> the old names somewhere, probably in the macros docs)
>>>>
>>>> Thoughts?
>>>>
>>>> -ash
>>>>
>>>>
>>>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
>>>> wrote:
>>>>
>>>> Hi Bas,
>>>>
>>>> 1) I am aware of a few places where those parameters are used in
>>>> production
>>>> in a few hundred jobs. I highly recommend we don't deprecate them
>>>> unless
>>>> we
>>>> do it in a major version.
>>>>
>>>> 2) As James mentioned, inlets and outlets are a lineage annotation
>>>> feature
>>>> which is still under development. Let's leave them in, but we can
>>> guard
>>>> them behind a feature flag if you prefer.
>>>>
>>>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
>>>> daily
>>>> ETL. I agree with you that they are simple to compute, but not
>>> everyone
>>>> using Apache Airflow is amazing with Python. Some users are only
>>> trying
>>>> to
>>>> get a query scheduled and rely on a couple of niceties like these to
>>>> get
>>>> by.
>>>>
>>>> 4) latest_date, end_date (I feel like there used to be start_date,
>>> but
>>>> maybe it got lost) were a blend of things which were used by a
>>> backfill
>>>> framework used internally at Airbnb. Latest date was used if you
>>> needed
>>>> to
>>>> join to a dimension for which you only wanted the latest version of
>>> the
>>>> attributes in you backfill. end_date was used for time ranges where
>>>> several
>>>> days were processed together in a range to save on compute. I don't
>>> see
>>>> an
>>>> issue with removing them.
>>>>
>>>> Best regards,
>>>> Arthur
>>>>
>>>>
>>>>
>>>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
>>>> basharenslak@godatadriven.com>
>>>> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Following Tao Feng’s question to discuss this PR<
>>>> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
>>>> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
>>>> here
>>>> if you agree/disagree/would change.
>>>>
>>>> -----------
>>>>
>>>> The summary of the PR:
>>>>
>>>> I was confused by the task context values and suggest to clean up and
>>>> clarify these variables. Some are derivations from other variables,
>>>> some
>>>> are undocumented and unused, some are wrong (name doesn’t match the
>>>> value).
>>>> Please discuss what you think of the removal of these variables:
>>>>
>>>>
>>>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>>>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
>>> useful
>>>> since these require complex logic to compute the next execution date,
>>>> however would leave computing the yesterday* and tomorrow* variables
>>>> up
>>>> to
>>>> the user since they are simple one-liners and don't relate to the DAG
>>>> interval.
>>>> * Removed tables. This is a field in params, and is thus also
>>>> accessible by the user ({{ params.tables }}). Also, it was
>>>> undocumented.
>>>> * Removed latest_date. It's the same as ds and was also
>>>> undocumented.
>>>> * Removed inlets and outlets. Also undocumented, and have the
>>>> inlets/outlets ever worked/ever been used by anybody?
>>>> * Removed end_date and END_DATE. Both have the same value, so it
>>>> doesn't make sense to have both variables. Also, the value is ds
>>> which
>>>> contains the start date of the interval, so the naming didn't make
>>>> sense to
>>>> me. However, if anybody argues in favour of adding "start_date" and
>>>> "end_date" to provide the start and end datetime of task instance
>>>> intervals, I'd be happy to add them.
>>>>
>>>> Cheers,
>>>> Bas
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Maxime Beauchemin <ma...@gmail.com>.
It should be labelled as a "bridge" or "transition" release somehow, and
tell the community to absolutely to go there first and address all
deprecation warnings prior to upgrade to 2.0. I wonder if semver has
something for that.
It might be the time to deprecate more things. Spring cleaning!
Should we start another thread labeled "[2.0 spring cleaning] what Airflow
features should we deprecate!?"
Max
On Thu, Apr 11, 2019 at 11:26 PM Ash Berlin-Taylor <as...@apache.org> wrote:
> I am happy to do another small(!) 1.10.x release.
>
> (There was a small bug I introduced where I broke the rendering of doc_md
> on dags)
>
> On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl>
> wrote:
> >I agree with Max here, we should be careful.
> >
> >Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >tomorrow_ds_nodash. I'm not against having better readable shorthands,
> >but
> >more about the fact that having a tomorrow_ds doesn't make sense when
> >we
> >have an hourly (or weekly) job.
> >
> >I'm against guarding the {in,out}lets. Since the guarding will add
> >extra
> >logic, and this is not worth the added complexity (and another flag) in
> >my
> >opinion.
> >
> >- We start by putting deprecation warnings on tables, latest_date,
> >end_date
> >and END_DATE and remove them in Airflow 2.0.
> >
> >This is only possible if there is another version before 2.0.
> >Currently,
> >we're preparing to move to 2.0
> >
> >- We add a lineage_enabled config which is false by default and thus
> >inlets/outlets aren’t provided, unless set to true.
> >
> >I'm against guarding the {in,out}lets. Since the guarding will add
> >extra
> >logic, and this is not worth the added complexity (and another flag) in
> >my
> >opinion.
> >
> >- We continue discussion about clarification of execution_date and
> >better
> >named variables such as something_start and something_end
> >
> >
> https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
> >
> >Cheers, Fokko
> >
> >Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
> >basharenslak@godatadriven.com>:
> >
> >> Great discussion, let’s stay on track. If I can summarise:
> >>
> >>
> >> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >tomorrow_ds_nodash
> >> * Arthur: some users use these for convenience
> >> * Bas/Fokko: these are values that can be easily derived in a
> >> one-liner
> >>
> >> * tables
> >> * nobody?
> >>
> >> * latest_date
> >> * Arthur: used by internal backfill framework at Airbnb, but
> >no
> >> issue removing them.
> >>
> >> * inlets/outlets
> >> * Arthur: still in development, could be guarded behind
> >feature
> >> flag.
> >>
> >> * end_date/END_DATE
> >> * Arthur: used by internal backfill framework at Airbnb, but
> >no
> >> issue removing them.
> >>
> >> And to add to the discussion:
> >>
> >>
> >> * execution_date
> >> * The meaning of execution_date is ambivalent and super
> >confusing
> >> to everybody because it’s not the date of execution.
> >> * Suggestions to add period_start/period_end, or
> >> interval_start/interval_end, or something like that, to provide
> >datetime
> >> variables for start & end datetime of a DAG run.
> >> * Other:
> >> * Removal of variables should be done in major version and
> >> deprecation warnings should be added.
> >>
> >> So how about the following:
> >> - We start by putting deprecation warnings on tables, latest_date,
> >> end_date and END_DATE and remove them in Airflow 2.0.
> >> - We add a lineage_enabled config which is false by default and thus
> >> inlets/outlets aren’t provided, unless set to true.
> >> - We continue discussion about yesterday* and tomorrow*
> >> - We continue discussion about clarification of execution_date and
> >better
> >> named variables such as something_start and something_end
> >>
> >> Cheers,
> >> Bas
> >>
> >>
> >> On 11 Apr 2019, at 04:52, Maxime Beauchemin
> ><maximebeauchemin@gmail.com
> >> <ma...@gmail.com>> wrote:
> >>
> >> Making backwards incompatible changes that require altering the
> >thousands
> >> (millions?!) of DAGs in the wild will alienate the community and
> >prevent
> >> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
> >Airflow
> >> atomically would be hard and dangerous.
> >>
> >> To mitigate this, changes to the DAG / core API should be backward
> >> compatible, at least for a release range, and alert on upcoming
> >deprecation
> >> (if needed)
> >>
> >> To be clear if `execution_date` is renamed to `foo`, we should have a
> >> version range where both work just as well, but using
> >`execution_date`
> >> would result is warning messages about its upcoming deprecation,
> >maybe
> >> something like "It appears you're using the task parameter
> >`execution_date`
> >> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
> >find
> >> more info at link.to/foo<http://link.to/foo>"
> >>
> >> Max
> >>
> >> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
> >>
> ><jm...@quantopian.com.invalid>>
> >> wrote:
> >>
> >> I agree with Ash here. The naming of "execution_date" is incredibly
> >> confusing to people who are new to Airflow, who think it has
> >something to
> >> do with... execution.
> >>
> >> However, I think that there's still room for improvement with
> >> "period_start" and "period_end". Think about manually triggered tasks
> >-
> >> they'd have a "period_start", but no useful "period_end" until the
> >next
> >> trigger occurs. And mid-day ETL tasks that are dated to "today" still
> >have
> >> to reference "period_end" to get the correct date, even though the
> >DAGrun
> >> won't be over yet!
> >>
> >> If we're going to go through and rename "execution_date", I'd rather
> >see a
> >> wider-ranging rework that understands a mapping from a date to a
> >window
> >> (like "every day, process the data from one week ago", or "every
> >Saturday,
> >> process today's data"). Maybe something closer to how Beam does it
> >> (but retaining simplicity for the 99% of cases that are just "run
> >daily,
> >> for the past day").
> >>
> >>
> >>
> >
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
> >>
> >> I could see something where there are two default DAG parameters are:
> >> schedule="@daily"
> >> window=-1 (or some schedule_delta object that provides a windowing
> >impl, or
> >> None if there is no window)
> >>
> >> In this world, all DAGRuns would have a "schedule_date" (the date
> >this
> >> would have normally started at), and an "execution_date" (when it was
> >> actually executed). If a given DAGrun has a window (one-off DAGs may
> >or may
> >> not!), there would be variables for "window_start" (the start of the
> >> window) and "window_end" (the end of the window; this would default
> >to the
> >> same as schedule_date, and to the next DAGrun's window_start).
> >>
> >> Disconnecting schedule date, execution date, and window/period would
> >also
> >> open a pathway for more advanced users to implement irregular
> >schedules and
> >> windows, without having to rely on hacks. For example: a DAG that
> >runs at
> >> "the end of the week" to produce a end-of-week would normally run on
> >> Friday, but on Friday holidays, instead complete a day early (and
> >scan one
> >> fewer day in its window).
> >>
> >> I know there's some historical baggage here, but I think the above is
> >much
> >> more natural to new users than what we're offering today. And I think
> >from
> >> a current user perspective, there would be breaking variable name
> >changes,
> >> but no logical differences for the majority of DAGs.
> >>
> >> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
> >wrote:
> >>
> >> To (slightly) hijack this thread:
> >>
> >> On the subject of execuction_date: as I'm sure we're all aware the
> >> concept
> >> of execution_date is confusing to new-commers to Airflow (there are
> >many
> >> questions about "why hasn't my DAG run yet"? "Why is my dag a day
> >> behind?"
> >> etc.) and although we mention this in the docs it's a confusing
> >concept.
> >>
> >> What to people think about adding two new parameters: `period_start`
> >and
> >> `period_end` and making these the preferred terms in place of
> >> execution_date and next_execution_date?
> >>
> >> This hopefully avoids any ambitious terms like "execution" or "run"
> >which
> >> is understandably easy to conflate with the time the task is being
> >run
> >> (i.e. `now()`)
> >>
> >> If people think this naming is better and less confusing I would
> >suggest
> >> we update all the docs and examples to use these terms (but still
> >mention
> >> the old names somewhere, probably in the macros docs)
> >>
> >> Thoughts?
> >>
> >> -ash
> >>
> >>
> >> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> >> wrote:
> >>
> >> Hi Bas,
> >>
> >> 1) I am aware of a few places where those parameters are used in
> >> production
> >> in a few hundred jobs. I highly recommend we don't deprecate them
> >> unless
> >> we
> >> do it in a major version.
> >>
> >> 2) As James mentioned, inlets and outlets are a lineage annotation
> >> feature
> >> which is still under development. Let's leave them in, but we can
> >guard
> >> them behind a feature flag if you prefer.
> >>
> >> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> >> daily
> >> ETL. I agree with you that they are simple to compute, but not
> >everyone
> >> using Apache Airflow is amazing with Python. Some users are only
> >trying
> >> to
> >> get a query scheduled and rely on a couple of niceties like these to
> >> get
> >> by.
> >>
> >> 4) latest_date, end_date (I feel like there used to be start_date,
> >but
> >> maybe it got lost) were a blend of things which were used by a
> >backfill
> >> framework used internally at Airbnb. Latest date was used if you
> >needed
> >> to
> >> join to a dimension for which you only wanted the latest version of
> >the
> >> attributes in you backfill. end_date was used for time ranges where
> >> several
> >> days were processed together in a range to save on compute. I don't
> >see
> >> an
> >> issue with removing them.
> >>
> >> Best regards,
> >> Arthur
> >>
> >>
> >>
> >> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> >> basharenslak@godatadriven.com>
> >> wrote:
> >>
> >> Hi all,
> >>
> >> Following Tao Feng’s question to discuss this PR<
> >> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> >> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> >> here
> >> if you agree/disagree/would change.
> >>
> >> -----------
> >>
> >> The summary of the PR:
> >>
> >> I was confused by the task context values and suggest to clean up and
> >> clarify these variables. Some are derivations from other variables,
> >> some
> >> are undocumented and unused, some are wrong (name doesn’t match the
> >> value).
> >> Please discuss what you think of the removal of these variables:
> >>
> >>
> >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
> >useful
> >> since these require complex logic to compute the next execution date,
> >> however would leave computing the yesterday* and tomorrow* variables
> >> up
> >> to
> >> the user since they are simple one-liners and don't relate to the DAG
> >> interval.
> >> * Removed tables. This is a field in params, and is thus also
> >> accessible by the user ({{ params.tables }}). Also, it was
> >> undocumented.
> >> * Removed latest_date. It's the same as ds and was also
> >> undocumented.
> >> * Removed inlets and outlets. Also undocumented, and have the
> >> inlets/outlets ever worked/ever been used by anybody?
> >> * Removed end_date and END_DATE. Both have the same value, so it
> >> doesn't make sense to have both variables. Also, the value is ds
> >which
> >> contains the start date of the interval, so the naming didn't make
> >> sense to
> >> me. However, if anybody argues in favour of adding "start_date" and
> >> "end_date" to provide the start and end datetime of task instance
> >> intervals, I'd be happy to add them.
> >>
> >> Cheers,
> >> Bas
> >>
> >>
> >>
> >>
> >>
> >>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task context variables
Posted by Ash Berlin-Taylor <as...@apache.org>.
I am happy to do another small(!) 1.10.x release.
(There was a small bug I introduced where I broke the rendering of doc_md on dags)
On 11 April 2019 22:52:13 BST, "Driesprong, Fokko" <fo...@driesprong.frl> wrote:
>I agree with Max here, we should be careful.
>
>Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>tomorrow_ds_nodash. I'm not against having better readable shorthands,
>but
>more about the fact that having a tomorrow_ds doesn't make sense when
>we
>have an hourly (or weekly) job.
>
>I'm against guarding the {in,out}lets. Since the guarding will add
>extra
>logic, and this is not worth the added complexity (and another flag) in
>my
>opinion.
>
>- We start by putting deprecation warnings on tables, latest_date,
>end_date
>and END_DATE and remove them in Airflow 2.0.
>
>This is only possible if there is another version before 2.0.
>Currently,
>we're preparing to move to 2.0
>
>- We add a lineage_enabled config which is false by default and thus
>inlets/outlets aren’t provided, unless set to true.
>
>I'm against guarding the {in,out}lets. Since the guarding will add
>extra
>logic, and this is not worth the added complexity (and another flag) in
>my
>opinion.
>
>- We continue discussion about clarification of execution_date and
>better
>named variables such as something_start and something_end
>
>https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
>
>Cheers, Fokko
>
>Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
>basharenslak@godatadriven.com>:
>
>> Great discussion, let’s stay on track. If I can summarise:
>>
>>
>> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>tomorrow_ds_nodash
>> * Arthur: some users use these for convenience
>> * Bas/Fokko: these are values that can be easily derived in a
>> one-liner
>>
>> * tables
>> * nobody?
>>
>> * latest_date
>> * Arthur: used by internal backfill framework at Airbnb, but
>no
>> issue removing them.
>>
>> * inlets/outlets
>> * Arthur: still in development, could be guarded behind
>feature
>> flag.
>>
>> * end_date/END_DATE
>> * Arthur: used by internal backfill framework at Airbnb, but
>no
>> issue removing them.
>>
>> And to add to the discussion:
>>
>>
>> * execution_date
>> * The meaning of execution_date is ambivalent and super
>confusing
>> to everybody because it’s not the date of execution.
>> * Suggestions to add period_start/period_end, or
>> interval_start/interval_end, or something like that, to provide
>datetime
>> variables for start & end datetime of a DAG run.
>> * Other:
>> * Removal of variables should be done in major version and
>> deprecation warnings should be added.
>>
>> So how about the following:
>> - We start by putting deprecation warnings on tables, latest_date,
>> end_date and END_DATE and remove them in Airflow 2.0.
>> - We add a lineage_enabled config which is false by default and thus
>> inlets/outlets aren’t provided, unless set to true.
>> - We continue discussion about yesterday* and tomorrow*
>> - We continue discussion about clarification of execution_date and
>better
>> named variables such as something_start and something_end
>>
>> Cheers,
>> Bas
>>
>>
>> On 11 Apr 2019, at 04:52, Maxime Beauchemin
><maximebeauchemin@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Making backwards incompatible changes that require altering the
>thousands
>> (millions?!) of DAGs in the wild will alienate the community and
>prevent
>> many from orchestrating an upgrade. Upgrading hundreds of DAGs and
>Airflow
>> atomically would be hard and dangerous.
>>
>> To mitigate this, changes to the DAG / core API should be backward
>> compatible, at least for a release range, and alert on upcoming
>deprecation
>> (if needed)
>>
>> To be clear if `execution_date` is renamed to `foo`, we should have a
>> version range where both work just as well, but using
>`execution_date`
>> would result is warning messages about its upcoming deprecation,
>maybe
>> something like "It appears you're using the task parameter
>`execution_date`
>> which will be deprecated in favor or `foo` in upcoming release 2.0.0,
>find
>> more info at link.to/foo<http://link.to/foo>"
>>
>> Max
>>
>> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
>>
><jm...@quantopian.com.invalid>>
>> wrote:
>>
>> I agree with Ash here. The naming of "execution_date" is incredibly
>> confusing to people who are new to Airflow, who think it has
>something to
>> do with... execution.
>>
>> However, I think that there's still room for improvement with
>> "period_start" and "period_end". Think about manually triggered tasks
>-
>> they'd have a "period_start", but no useful "period_end" until the
>next
>> trigger occurs. And mid-day ETL tasks that are dated to "today" still
>have
>> to reference "period_end" to get the correct date, even though the
>DAGrun
>> won't be over yet!
>>
>> If we're going to go through and rename "execution_date", I'd rather
>see a
>> wider-ranging rework that understands a mapping from a date to a
>window
>> (like "every day, process the data from one week ago", or "every
>Saturday,
>> process today's data"). Maybe something closer to how Beam does it
>> (but retaining simplicity for the 99% of cases that are just "run
>daily,
>> for the past day").
>>
>>
>>
>https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>>
>> I could see something where there are two default DAG parameters are:
>> schedule="@daily"
>> window=-1 (or some schedule_delta object that provides a windowing
>impl, or
>> None if there is no window)
>>
>> In this world, all DAGRuns would have a "schedule_date" (the date
>this
>> would have normally started at), and an "execution_date" (when it was
>> actually executed). If a given DAGrun has a window (one-off DAGs may
>or may
>> not!), there would be variables for "window_start" (the start of the
>> window) and "window_end" (the end of the window; this would default
>to the
>> same as schedule_date, and to the next DAGrun's window_start).
>>
>> Disconnecting schedule date, execution date, and window/period would
>also
>> open a pathway for more advanced users to implement irregular
>schedules and
>> windows, without having to rely on hacks. For example: a DAG that
>runs at
>> "the end of the week" to produce a end-of-week would normally run on
>> Friday, but on Friday holidays, instead complete a day early (and
>scan one
>> fewer day in its window).
>>
>> I know there's some historical baggage here, but I think the above is
>much
>> more natural to new users than what we're offering today. And I think
>from
>> a current user perspective, there would be breaking variable name
>changes,
>> but no logical differences for the majority of DAGs.
>>
>> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org>
>wrote:
>>
>> To (slightly) hijack this thread:
>>
>> On the subject of execuction_date: as I'm sure we're all aware the
>> concept
>> of execution_date is confusing to new-commers to Airflow (there are
>many
>> questions about "why hasn't my DAG run yet"? "Why is my dag a day
>> behind?"
>> etc.) and although we mention this in the docs it's a confusing
>concept.
>>
>> What to people think about adding two new parameters: `period_start`
>and
>> `period_end` and making these the preferred terms in place of
>> execution_date and next_execution_date?
>>
>> This hopefully avoids any ambitious terms like "execution" or "run"
>which
>> is understandably easy to conflate with the time the task is being
>run
>> (i.e. `now()`)
>>
>> If people think this naming is better and less confusing I would
>suggest
>> we update all the docs and examples to use these terms (but still
>mention
>> the old names somewhere, probably in the macros docs)
>>
>> Thoughts?
>>
>> -ash
>>
>>
>> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
>> wrote:
>>
>> Hi Bas,
>>
>> 1) I am aware of a few places where those parameters are used in
>> production
>> in a few hundred jobs. I highly recommend we don't deprecate them
>> unless
>> we
>> do it in a major version.
>>
>> 2) As James mentioned, inlets and outlets are a lineage annotation
>> feature
>> which is still under development. Let's leave them in, but we can
>guard
>> them behind a feature flag if you prefer.
>>
>> 3) the yesterday*/tomorrow* params are convenience ones if you use a
>> daily
>> ETL. I agree with you that they are simple to compute, but not
>everyone
>> using Apache Airflow is amazing with Python. Some users are only
>trying
>> to
>> get a query scheduled and rely on a couple of niceties like these to
>> get
>> by.
>>
>> 4) latest_date, end_date (I feel like there used to be start_date,
>but
>> maybe it got lost) were a blend of things which were used by a
>backfill
>> framework used internally at Airbnb. Latest date was used if you
>needed
>> to
>> join to a dimension for which you only wanted the latest version of
>the
>> attributes in you backfill. end_date was used for time ranges where
>> several
>> days were processed together in a range to save on compute. I don't
>see
>> an
>> issue with removing them.
>>
>> Best regards,
>> Arthur
>>
>>
>>
>> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
>> basharenslak@godatadriven.com>
>> wrote:
>>
>> Hi all,
>>
>> Following Tao Feng’s question to discuss this PR<
>> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
>> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
>> here
>> if you agree/disagree/would change.
>>
>> -----------
>>
>> The summary of the PR:
>>
>> I was confused by the task context values and suggest to clean up and
>> clarify these variables. Some are derivations from other variables,
>> some
>> are undocumented and unused, some are wrong (name doesn’t match the
>> value).
>> Please discuss what you think of the removal of these variables:
>>
>>
>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are
>useful
>> since these require complex logic to compute the next execution date,
>> however would leave computing the yesterday* and tomorrow* variables
>> up
>> to
>> the user since they are simple one-liners and don't relate to the DAG
>> interval.
>> * Removed tables. This is a field in params, and is thus also
>> accessible by the user ({{ params.tables }}). Also, it was
>> undocumented.
>> * Removed latest_date. It's the same as ds and was also
>> undocumented.
>> * Removed inlets and outlets. Also undocumented, and have the
>> inlets/outlets ever worked/ever been used by anybody?
>> * Removed end_date and END_DATE. Both have the same value, so it
>> doesn't make sense to have both variables. Also, the value is ds
>which
>> contains the start date of the interval, so the naming didn't make
>> sense to
>> me. However, if anybody argues in favour of adding "start_date" and
>> "end_date" to provide the start and end datetime of task instance
>> intervals, I'd be happy to add them.
>>
>> Cheers,
>> Bas
>>
>>
>>
>>
>>
>>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by "Driesprong, Fokko" <fo...@driesprong.frl>.
I agree with Max here, we should be careful.
Regarding the yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. I'm not against having better readable shorthands, but
more about the fact that having a tomorrow_ds doesn't make sense when we
have an hourly (or weekly) job.
I'm against guarding the {in,out}lets. Since the guarding will add extra
logic, and this is not worth the added complexity (and another flag) in my
opinion.
- We start by putting deprecation warnings on tables, latest_date, end_date
and END_DATE and remove them in Airflow 2.0.
This is only possible if there is another version before 2.0. Currently,
we're preparing to move to 2.0
- We add a lineage_enabled config which is false by default and thus
inlets/outlets aren’t provided, unless set to true.
I'm against guarding the {in,out}lets. Since the guarding will add extra
logic, and this is not worth the added complexity (and another flag) in my
opinion.
- We continue discussion about clarification of execution_date and better
named variables such as something_start and something_end
https://lists.apache.org/thread.html/31423aa7feba421c53356a1e566f777c7a7973966c3320611286a2fb@%3Cdev.airflow.apache.org%3E
Cheers, Fokko
Op do 11 apr. 2019 om 08:44 schreef Bas Harenslak <
basharenslak@godatadriven.com>:
> Great discussion, let’s stay on track. If I can summarise:
>
>
> * yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash
> * Arthur: some users use these for convenience
> * Bas/Fokko: these are values that can be easily derived in a
> one-liner
>
> * tables
> * nobody?
>
> * latest_date
> * Arthur: used by internal backfill framework at Airbnb, but no
> issue removing them.
>
> * inlets/outlets
> * Arthur: still in development, could be guarded behind feature
> flag.
>
> * end_date/END_DATE
> * Arthur: used by internal backfill framework at Airbnb, but no
> issue removing them.
>
> And to add to the discussion:
>
>
> * execution_date
> * The meaning of execution_date is ambivalent and super confusing
> to everybody because it’s not the date of execution.
> * Suggestions to add period_start/period_end, or
> interval_start/interval_end, or something like that, to provide datetime
> variables for start & end datetime of a DAG run.
> * Other:
> * Removal of variables should be done in major version and
> deprecation warnings should be added.
>
> So how about the following:
> - We start by putting deprecation warnings on tables, latest_date,
> end_date and END_DATE and remove them in Airflow 2.0.
> - We add a lineage_enabled config which is false by default and thus
> inlets/outlets aren’t provided, unless set to true.
> - We continue discussion about yesterday* and tomorrow*
> - We continue discussion about clarification of execution_date and better
> named variables such as something_start and something_end
>
> Cheers,
> Bas
>
>
> On 11 Apr 2019, at 04:52, Maxime Beauchemin <maximebeauchemin@gmail.com
> <ma...@gmail.com>> wrote:
>
> Making backwards incompatible changes that require altering the thousands
> (millions?!) of DAGs in the wild will alienate the community and prevent
> many from orchestrating an upgrade. Upgrading hundreds of DAGs and Airflow
> atomically would be hard and dangerous.
>
> To mitigate this, changes to the DAG / core API should be backward
> compatible, at least for a release range, and alert on upcoming deprecation
> (if needed)
>
> To be clear if `execution_date` is renamed to `foo`, we should have a
> version range where both work just as well, but using `execution_date`
> would result is warning messages about its upcoming deprecation, maybe
> something like "It appears you're using the task parameter `execution_date`
> which will be deprecated in favor or `foo` in upcoming release 2.0.0, find
> more info at link.to/foo<http://link.to/foo>"
>
> Max
>
> On Tue, Apr 9, 2019 at 7:58 AM James Meickle
> <jm...@quantopian.com.invalid>>
> wrote:
>
> I agree with Ash here. The naming of "execution_date" is incredibly
> confusing to people who are new to Airflow, who think it has something to
> do with... execution.
>
> However, I think that there's still room for improvement with
> "period_start" and "period_end". Think about manually triggered tasks -
> they'd have a "period_start", but no useful "period_end" until the next
> trigger occurs. And mid-day ETL tasks that are dated to "today" still have
> to reference "period_end" to get the correct date, even though the DAGrun
> won't be over yet!
>
> If we're going to go through and rename "execution_date", I'd rather see a
> wider-ranging rework that understands a mapping from a date to a window
> (like "every day, process the data from one week ago", or "every Saturday,
> process today's data"). Maybe something closer to how Beam does it
> (but retaining simplicity for the 99% of cases that are just "run daily,
> for the past day").
>
>
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>
> I could see something where there are two default DAG parameters are:
> schedule="@daily"
> window=-1 (or some schedule_delta object that provides a windowing impl, or
> None if there is no window)
>
> In this world, all DAGRuns would have a "schedule_date" (the date this
> would have normally started at), and an "execution_date" (when it was
> actually executed). If a given DAGrun has a window (one-off DAGs may or may
> not!), there would be variables for "window_start" (the start of the
> window) and "window_end" (the end of the window; this would default to the
> same as schedule_date, and to the next DAGrun's window_start).
>
> Disconnecting schedule date, execution date, and window/period would also
> open a pathway for more advanced users to implement irregular schedules and
> windows, without having to rely on hacks. For example: a DAG that runs at
> "the end of the week" to produce a end-of-week would normally run on
> Friday, but on Friday holidays, instead complete a day early (and scan one
> fewer day in its window).
>
> I know there's some historical baggage here, but I think the above is much
> more natural to new users than what we're offering today. And I think from
> a current user perspective, there would be breaking variable name changes,
> but no logical differences for the majority of DAGs.
>
> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org> wrote:
>
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the
> concept
> of execution_date is confusing to new-commers to Airflow (there are many
> questions about "why hasn't my DAG run yet"? "Why is my dag a day
> behind?"
> etc.) and although we mention this in the docs it's a confusing concept.
>
> What to people think about adding two new parameters: `period_start` and
> `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run" which
> is understandably easy to conflate with the time the task is being run
> (i.e. `now()`)
>
> If people think this naming is better and less confusing I would suggest
> we update all the docs and examples to use these terms (but still mention
> the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> wrote:
>
> Hi Bas,
>
> 1) I am aware of a few places where those parameters are used in
> production
> in a few hundred jobs. I highly recommend we don't deprecate them
> unless
> we
> do it in a major version.
>
> 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> which is still under development. Let's leave them in, but we can guard
> them behind a feature flag if you prefer.
>
> 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> ETL. I agree with you that they are simple to compute, but not everyone
> using Apache Airflow is amazing with Python. Some users are only trying
> to
> get a query scheduled and rely on a couple of niceties like these to
> get
> by.
>
> 4) latest_date, end_date (I feel like there used to be start_date, but
> maybe it got lost) were a blend of things which were used by a backfill
> framework used internally at Airbnb. Latest date was used if you needed
> to
> join to a dimension for which you only wanted the latest version of the
> attributes in you backfill. end_date was used for time ranges where
> several
> days were processed together in a range to save on compute. I don't see
> an
> issue with removing them.
>
> Best regards,
> Arthur
>
>
>
> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com>
> wrote:
>
> Hi all,
>
> Following Tao Feng’s question to discuss this PR<
> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> here
> if you agree/disagree/would change.
>
> -----------
>
> The summary of the PR:
>
> I was confused by the task context values and suggest to clean up and
> clarify these variables. Some are derivations from other variables,
> some
> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> Please discuss what you think of the removal of these variables:
>
>
> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> since these require complex logic to compute the next execution date,
> however would leave computing the yesterday* and tomorrow* variables
> up
> to
> the user since they are simple one-liners and don't relate to the DAG
> interval.
> * Removed tables. This is a field in params, and is thus also
> accessible by the user ({{ params.tables }}). Also, it was
> undocumented.
> * Removed latest_date. It's the same as ds and was also
> undocumented.
> * Removed inlets and outlets. Also undocumented, and have the
> inlets/outlets ever worked/ever been used by anybody?
> * Removed end_date and END_DATE. Both have the same value, so it
> doesn't make sense to have both variables. Also, the value is ds which
> contains the start date of the interval, so the naming didn't make
> sense to
> me. However, if anybody argues in favour of adding "start_date" and
> "end_date" to provide the start and end datetime of task instance
> intervals, I'd be happy to add them.
>
> Cheers,
> Bas
>
>
>
>
>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Bas Harenslak <ba...@godatadriven.com>.
Great discussion, let’s stay on track. If I can summarise:
* yesterday_ds, yesterday_ds_nodash, tomorrow_ds, tomorrow_ds_nodash
* Arthur: some users use these for convenience
* Bas/Fokko: these are values that can be easily derived in a one-liner
* tables
* nobody?
* latest_date
* Arthur: used by internal backfill framework at Airbnb, but no issue removing them.
* inlets/outlets
* Arthur: still in development, could be guarded behind feature flag.
* end_date/END_DATE
* Arthur: used by internal backfill framework at Airbnb, but no issue removing them.
And to add to the discussion:
* execution_date
* The meaning of execution_date is ambivalent and super confusing to everybody because it’s not the date of execution.
* Suggestions to add period_start/period_end, or interval_start/interval_end, or something like that, to provide datetime variables for start & end datetime of a DAG run.
* Other:
* Removal of variables should be done in major version and deprecation warnings should be added.
So how about the following:
- We start by putting deprecation warnings on tables, latest_date, end_date and END_DATE and remove them in Airflow 2.0.
- We add a lineage_enabled config which is false by default and thus inlets/outlets aren’t provided, unless set to true.
- We continue discussion about yesterday* and tomorrow*
- We continue discussion about clarification of execution_date and better named variables such as something_start and something_end
Cheers,
Bas
On 11 Apr 2019, at 04:52, Maxime Beauchemin <ma...@gmail.com>> wrote:
Making backwards incompatible changes that require altering the thousands
(millions?!) of DAGs in the wild will alienate the community and prevent
many from orchestrating an upgrade. Upgrading hundreds of DAGs and Airflow
atomically would be hard and dangerous.
To mitigate this, changes to the DAG / core API should be backward
compatible, at least for a release range, and alert on upcoming deprecation
(if needed)
To be clear if `execution_date` is renamed to `foo`, we should have a
version range where both work just as well, but using `execution_date`
would result is warning messages about its upcoming deprecation, maybe
something like "It appears you're using the task parameter `execution_date`
which will be deprecated in favor or `foo` in upcoming release 2.0.0, find
more info at link.to/foo<http://link.to/foo>"
Max
On Tue, Apr 9, 2019 at 7:58 AM James Meickle
<jm...@quantopian.com.invalid>> wrote:
I agree with Ash here. The naming of "execution_date" is incredibly
confusing to people who are new to Airflow, who think it has something to
do with... execution.
However, I think that there's still room for improvement with
"period_start" and "period_end". Think about manually triggered tasks -
they'd have a "period_start", but no useful "period_end" until the next
trigger occurs. And mid-day ETL tasks that are dated to "today" still have
to reference "period_end" to get the correct date, even though the DAGrun
won't be over yet!
If we're going to go through and rename "execution_date", I'd rather see a
wider-ranging rework that understands a mapping from a date to a window
(like "every day, process the data from one week ago", or "every Saturday,
process today's data"). Maybe something closer to how Beam does it
(but retaining simplicity for the 99% of cases that are just "run daily,
for the past day").
https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
I could see something where there are two default DAG parameters are:
schedule="@daily"
window=-1 (or some schedule_delta object that provides a windowing impl, or
None if there is no window)
In this world, all DAGRuns would have a "schedule_date" (the date this
would have normally started at), and an "execution_date" (when it was
actually executed). If a given DAGrun has a window (one-off DAGs may or may
not!), there would be variables for "window_start" (the start of the
window) and "window_end" (the end of the window; this would default to the
same as schedule_date, and to the next DAGrun's window_start).
Disconnecting schedule date, execution date, and window/period would also
open a pathway for more advanced users to implement irregular schedules and
windows, without having to rely on hacks. For example: a DAG that runs at
"the end of the week" to produce a end-of-week would normally run on
Friday, but on Friday holidays, instead complete a day early (and scan one
fewer day in its window).
I know there's some historical baggage here, but I think the above is much
more natural to new users than what we're offering today. And I think from
a current user perspective, there would be breaking variable name changes,
but no logical differences for the majority of DAGs.
On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org> wrote:
To (slightly) hijack this thread:
On the subject of execuction_date: as I'm sure we're all aware the
concept
of execution_date is confusing to new-commers to Airflow (there are many
questions about "why hasn't my DAG run yet"? "Why is my dag a day
behind?"
etc.) and although we mention this in the docs it's a confusing concept.
What to people think about adding two new parameters: `period_start` and
`period_end` and making these the preferred terms in place of
execution_date and next_execution_date?
This hopefully avoids any ambitious terms like "execution" or "run" which
is understandably easy to conflate with the time the task is being run
(i.e. `now()`)
If people think this naming is better and less confusing I would suggest
we update all the docs and examples to use these terms (but still mention
the old names somewhere, probably in the macros docs)
Thoughts?
-ash
On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
wrote:
Hi Bas,
1) I am aware of a few places where those parameters are used in
production
in a few hundred jobs. I highly recommend we don't deprecate them
unless
we
do it in a major version.
2) As James mentioned, inlets and outlets are a lineage annotation
feature
which is still under development. Let's leave them in, but we can guard
them behind a feature flag if you prefer.
3) the yesterday*/tomorrow* params are convenience ones if you use a
daily
ETL. I agree with you that they are simple to compute, but not everyone
using Apache Airflow is amazing with Python. Some users are only trying
to
get a query scheduled and rely on a couple of niceties like these to
get
by.
4) latest_date, end_date (I feel like there used to be start_date, but
maybe it got lost) were a blend of things which were used by a backfill
framework used internally at Airbnb. Latest date was used if you needed
to
join to a dimension for which you only wanted the latest version of the
attributes in you backfill. end_date was used for time ranges where
several
days were processed together in a range to save on compute. I don't see
an
issue with removing them.
Best regards,
Arthur
On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
basharenslak@godatadriven.com>
wrote:
Hi all,
Following Tao Feng’s question to discuss this PR<
https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
here
if you agree/disagree/would change.
-----------
The summary of the PR:
I was confused by the task context values and suggest to clean up and
clarify these variables. Some are derivations from other variables,
some
are undocumented and unused, some are wrong (name doesn’t match the
value).
Please discuss what you think of the removal of these variables:
* Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
since these require complex logic to compute the next execution date,
however would leave computing the yesterday* and tomorrow* variables
up
to
the user since they are simple one-liners and don't relate to the DAG
interval.
* Removed tables. This is a field in params, and is thus also
accessible by the user ({{ params.tables }}). Also, it was
undocumented.
* Removed latest_date. It's the same as ds and was also
undocumented.
* Removed inlets and outlets. Also undocumented, and have the
inlets/outlets ever worked/ever been used by anybody?
* Removed end_date and END_DATE. Both have the same value, so it
doesn't make sense to have both variables. Also, the value is ds which
contains the start date of the interval, so the naming didn't make
sense to
me. However, if anybody argues in favour of adding "start_date" and
"end_date" to provide the start and end datetime of task instance
intervals, I'd be happy to add them.
Cheers,
Bas
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Maxime Beauchemin <ma...@gmail.com>.
Making backwards incompatible changes that require altering the thousands
(millions?!) of DAGs in the wild will alienate the community and prevent
many from orchestrating an upgrade. Upgrading hundreds of DAGs and Airflow
atomically would be hard and dangerous.
To mitigate this, changes to the DAG / core API should be backward
compatible, at least for a release range, and alert on upcoming deprecation
(if needed)
To be clear if `execution_date` is renamed to `foo`, we should have a
version range where both work just as well, but using `execution_date`
would result is warning messages about its upcoming deprecation, maybe
something like "It appears you're using the task parameter `execution_date`
which will be deprecated in favor or `foo` in upcoming release 2.0.0, find
more info at link.to/foo"
Max
On Tue, Apr 9, 2019 at 7:58 AM James Meickle
<jm...@quantopian.com.invalid> wrote:
> I agree with Ash here. The naming of "execution_date" is incredibly
> confusing to people who are new to Airflow, who think it has something to
> do with... execution.
>
> However, I think that there's still room for improvement with
> "period_start" and "period_end". Think about manually triggered tasks -
> they'd have a "period_start", but no useful "period_end" until the next
> trigger occurs. And mid-day ETL tasks that are dated to "today" still have
> to reference "period_end" to get the correct date, even though the DAGrun
> won't be over yet!
>
> If we're going to go through and rename "execution_date", I'd rather see a
> wider-ranging rework that understands a mapping from a date to a window
> (like "every day, process the data from one week ago", or "every Saturday,
> process today's data"). Maybe something closer to how Beam does it
> (but retaining simplicity for the 99% of cases that are just "run daily,
> for the past day").
>
> https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
>
> I could see something where there are two default DAG parameters are:
> schedule="@daily"
> window=-1 (or some schedule_delta object that provides a windowing impl, or
> None if there is no window)
>
> In this world, all DAGRuns would have a "schedule_date" (the date this
> would have normally started at), and an "execution_date" (when it was
> actually executed). If a given DAGrun has a window (one-off DAGs may or may
> not!), there would be variables for "window_start" (the start of the
> window) and "window_end" (the end of the window; this would default to the
> same as schedule_date, and to the next DAGrun's window_start).
>
> Disconnecting schedule date, execution date, and window/period would also
> open a pathway for more advanced users to implement irregular schedules and
> windows, without having to rely on hacks. For example: a DAG that runs at
> "the end of the week" to produce a end-of-week would normally run on
> Friday, but on Friday holidays, instead complete a day early (and scan one
> fewer day in its window).
>
> I know there's some historical baggage here, but I think the above is much
> more natural to new users than what we're offering today. And I think from
> a current user perspective, there would be breaking variable name changes,
> but no logical differences for the majority of DAGs.
>
> On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org> wrote:
>
> > To (slightly) hijack this thread:
> >
> > On the subject of execuction_date: as I'm sure we're all aware the
> concept
> > of execution_date is confusing to new-commers to Airflow (there are many
> > questions about "why hasn't my DAG run yet"? "Why is my dag a day
> behind?"
> > etc.) and although we mention this in the docs it's a confusing concept.
> >
> > What to people think about adding two new parameters: `period_start` and
> > `period_end` and making these the preferred terms in place of
> > execution_date and next_execution_date?
> >
> > This hopefully avoids any ambitious terms like "execution" or "run" which
> > is understandably easy to conflate with the time the task is being run
> > (i.e. `now()`)
> >
> > If people think this naming is better and less confusing I would suggest
> > we update all the docs and examples to use these terms (but still mention
> > the old names somewhere, probably in the macros docs)
> >
> > Thoughts?
> >
> > -ash
> >
> >
> > > On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> > wrote:
> > >
> > > Hi Bas,
> > >
> > > 1) I am aware of a few places where those parameters are used in
> > production
> > > in a few hundred jobs. I highly recommend we don't deprecate them
> unless
> > we
> > > do it in a major version.
> > >
> > > 2) As James mentioned, inlets and outlets are a lineage annotation
> > feature
> > > which is still under development. Let's leave them in, but we can guard
> > > them behind a feature flag if you prefer.
> > >
> > > 3) the yesterday*/tomorrow* params are convenience ones if you use a
> > daily
> > > ETL. I agree with you that they are simple to compute, but not everyone
> > > using Apache Airflow is amazing with Python. Some users are only trying
> > to
> > > get a query scheduled and rely on a couple of niceties like these to
> get
> > by.
> > >
> > > 4) latest_date, end_date (I feel like there used to be start_date, but
> > > maybe it got lost) were a blend of things which were used by a backfill
> > > framework used internally at Airbnb. Latest date was used if you needed
> > to
> > > join to a dimension for which you only wanted the latest version of the
> > > attributes in you backfill. end_date was used for time ranges where
> > several
> > > days were processed together in a range to save on compute. I don't see
> > an
> > > issue with removing them.
> > >
> > > Best regards,
> > > Arthur
> > >
> > >
> > >
> > > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> > basharenslak@godatadriven.com>
> > > wrote:
> > >
> > >> Hi all,
> > >>
> > >> Following Tao Feng’s question to discuss this PR<
> > >> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> > >> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> > here
> > >> if you agree/disagree/would change.
> > >>
> > >> -----------
> > >>
> > >> The summary of the PR:
> > >>
> > >> I was confused by the task context values and suggest to clean up and
> > >> clarify these variables. Some are derivations from other variables,
> some
> > >> are undocumented and unused, some are wrong (name doesn’t match the
> > value).
> > >> Please discuss what you think of the removal of these variables:
> > >>
> > >>
> > >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> > >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> > >> since these require complex logic to compute the next execution date,
> > >> however would leave computing the yesterday* and tomorrow* variables
> up
> > to
> > >> the user since they are simple one-liners and don't relate to the DAG
> > >> interval.
> > >> * Removed tables. This is a field in params, and is thus also
> > >> accessible by the user ({{ params.tables }}). Also, it was
> undocumented.
> > >> * Removed latest_date. It's the same as ds and was also
> undocumented.
> > >> * Removed inlets and outlets. Also undocumented, and have the
> > >> inlets/outlets ever worked/ever been used by anybody?
> > >> * Removed end_date and END_DATE. Both have the same value, so it
> > >> doesn't make sense to have both variables. Also, the value is ds which
> > >> contains the start date of the interval, so the naming didn't make
> > sense to
> > >> me. However, if anybody argues in favour of adding "start_date" and
> > >> "end_date" to provide the start and end datetime of task instance
> > >> intervals, I'd be happy to add them.
> > >>
> > >> Cheers,
> > >> Bas
> > >>
> >
> >
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by James Meickle <jm...@quantopian.com.INVALID>.
I agree with Ash here. The naming of "execution_date" is incredibly
confusing to people who are new to Airflow, who think it has something to
do with... execution.
However, I think that there's still room for improvement with
"period_start" and "period_end". Think about manually triggered tasks -
they'd have a "period_start", but no useful "period_end" until the next
trigger occurs. And mid-day ETL tasks that are dated to "today" still have
to reference "period_end" to get the correct date, even though the DAGrun
won't be over yet!
If we're going to go through and rename "execution_date", I'd rather see a
wider-ranging rework that understands a mapping from a date to a window
(like "every day, process the data from one week ago", or "every Saturday,
process today's data"). Maybe something closer to how Beam does it
(but retaining simplicity for the 99% of cases that are just "run daily,
for the past day").
https://beam.apache.org/documentation/programming-guide/#provided-windowing-functions
I could see something where there are two default DAG parameters are:
schedule="@daily"
window=-1 (or some schedule_delta object that provides a windowing impl, or
None if there is no window)
In this world, all DAGRuns would have a "schedule_date" (the date this
would have normally started at), and an "execution_date" (when it was
actually executed). If a given DAGrun has a window (one-off DAGs may or may
not!), there would be variables for "window_start" (the start of the
window) and "window_end" (the end of the window; this would default to the
same as schedule_date, and to the next DAGrun's window_start).
Disconnecting schedule date, execution date, and window/period would also
open a pathway for more advanced users to implement irregular schedules and
windows, without having to rely on hacks. For example: a DAG that runs at
"the end of the week" to produce a end-of-week would normally run on
Friday, but on Friday holidays, instead complete a day early (and scan one
fewer day in its window).
I know there's some historical baggage here, but I think the above is much
more natural to new users than what we're offering today. And I think from
a current user perspective, there would be breaking variable name changes,
but no logical differences for the majority of DAGs.
On Tue, Apr 9, 2019 at 6:17 AM Ash Berlin-Taylor <as...@apache.org> wrote:
> To (slightly) hijack this thread:
>
> On the subject of execuction_date: as I'm sure we're all aware the concept
> of execution_date is confusing to new-commers to Airflow (there are many
> questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?"
> etc.) and although we mention this in the docs it's a confusing concept.
>
> What to people think about adding two new parameters: `period_start` and
> `period_end` and making these the preferred terms in place of
> execution_date and next_execution_date?
>
> This hopefully avoids any ambitious terms like "execution" or "run" which
> is understandably easy to conflate with the time the task is being run
> (i.e. `now()`)
>
> If people think this naming is better and less confusing I would suggest
> we update all the docs and examples to use these terms (but still mention
> the old names somewhere, probably in the macros docs)
>
> Thoughts?
>
> -ash
>
>
> > On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com>
> wrote:
> >
> > Hi Bas,
> >
> > 1) I am aware of a few places where those parameters are used in
> production
> > in a few hundred jobs. I highly recommend we don't deprecate them unless
> we
> > do it in a major version.
> >
> > 2) As James mentioned, inlets and outlets are a lineage annotation
> feature
> > which is still under development. Let's leave them in, but we can guard
> > them behind a feature flag if you prefer.
> >
> > 3) the yesterday*/tomorrow* params are convenience ones if you use a
> daily
> > ETL. I agree with you that they are simple to compute, but not everyone
> > using Apache Airflow is amazing with Python. Some users are only trying
> to
> > get a query scheduled and rely on a couple of niceties like these to get
> by.
> >
> > 4) latest_date, end_date (I feel like there used to be start_date, but
> > maybe it got lost) were a blend of things which were used by a backfill
> > framework used internally at Airbnb. Latest date was used if you needed
> to
> > join to a dimension for which you only wanted the latest version of the
> > attributes in you backfill. end_date was used for time ranges where
> several
> > days were processed together in a range to save on compute. I don't see
> an
> > issue with removing them.
> >
> > Best regards,
> > Arthur
> >
> >
> >
> > On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <
> basharenslak@godatadriven.com>
> > wrote:
> >
> >> Hi all,
> >>
> >> Following Tao Feng’s question to discuss this PR<
> >> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> >> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss
> here
> >> if you agree/disagree/would change.
> >>
> >> -----------
> >>
> >> The summary of the PR:
> >>
> >> I was confused by the task context values and suggest to clean up and
> >> clarify these variables. Some are derivations from other variables, some
> >> are undocumented and unused, some are wrong (name doesn’t match the
> value).
> >> Please discuss what you think of the removal of these variables:
> >>
> >>
> >> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> >> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> >> since these require complex logic to compute the next execution date,
> >> however would leave computing the yesterday* and tomorrow* variables up
> to
> >> the user since they are simple one-liners and don't relate to the DAG
> >> interval.
> >> * Removed tables. This is a field in params, and is thus also
> >> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> >> * Removed latest_date. It's the same as ds and was also undocumented.
> >> * Removed inlets and outlets. Also undocumented, and have the
> >> inlets/outlets ever worked/ever been used by anybody?
> >> * Removed end_date and END_DATE. Both have the same value, so it
> >> doesn't make sense to have both variables. Also, the value is ds which
> >> contains the start date of the interval, so the naming didn't make
> sense to
> >> me. However, if anybody argues in favour of adding "start_date" and
> >> "end_date" to provide the start and end datetime of task instance
> >> intervals, I'd be happy to add them.
> >>
> >> Cheers,
> >> Bas
> >>
>
>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Ash Berlin-Taylor <as...@apache.org>.
To (slightly) hijack this thread:
On the subject of execuction_date: as I'm sure we're all aware the concept of execution_date is confusing to new-commers to Airflow (there are many questions about "why hasn't my DAG run yet"? "Why is my dag a day behind?" etc.) and although we mention this in the docs it's a confusing concept.
What to people think about adding two new parameters: `period_start` and `period_end` and making these the preferred terms in place of execution_date and next_execution_date?
This hopefully avoids any ambitious terms like "execution" or "run" which is understandably easy to conflate with the time the task is being run (i.e. `now()`)
If people think this naming is better and less confusing I would suggest we update all the docs and examples to use these terms (but still mention the old names somewhere, probably in the macros docs)
Thoughts?
-ash
> On 8 Apr 2019, at 16:20, Arthur Wiedmer <ar...@gmail.com> wrote:
>
> Hi Bas,
>
> 1) I am aware of a few places where those parameters are used in production
> in a few hundred jobs. I highly recommend we don't deprecate them unless we
> do it in a major version.
>
> 2) As James mentioned, inlets and outlets are a lineage annotation feature
> which is still under development. Let's leave them in, but we can guard
> them behind a feature flag if you prefer.
>
> 3) the yesterday*/tomorrow* params are convenience ones if you use a daily
> ETL. I agree with you that they are simple to compute, but not everyone
> using Apache Airflow is amazing with Python. Some users are only trying to
> get a query scheduled and rely on a couple of niceties like these to get by.
>
> 4) latest_date, end_date (I feel like there used to be start_date, but
> maybe it got lost) were a blend of things which were used by a backfill
> framework used internally at Airbnb. Latest date was used if you needed to
> join to a dimension for which you only wanted the latest version of the
> attributes in you backfill. end_date was used for time ranges where several
> days were processed together in a range to save on compute. I don't see an
> issue with removing them.
>
> Best regards,
> Arthur
>
>
>
> On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <ba...@godatadriven.com>
> wrote:
>
>> Hi all,
>>
>> Following Tao Feng’s question to discuss this PR<
>> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
>> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss here
>> if you agree/disagree/would change.
>>
>> -----------
>>
>> The summary of the PR:
>>
>> I was confused by the task context values and suggest to clean up and
>> clarify these variables. Some are derivations from other variables, some
>> are undocumented and unused, some are wrong (name doesn’t match the value).
>> Please discuss what you think of the removal of these variables:
>>
>>
>> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
>> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
>> since these require complex logic to compute the next execution date,
>> however would leave computing the yesterday* and tomorrow* variables up to
>> the user since they are simple one-liners and don't relate to the DAG
>> interval.
>> * Removed tables. This is a field in params, and is thus also
>> accessible by the user ({{ params.tables }}). Also, it was undocumented.
>> * Removed latest_date. It's the same as ds and was also undocumented.
>> * Removed inlets and outlets. Also undocumented, and have the
>> inlets/outlets ever worked/ever been used by anybody?
>> * Removed end_date and END_DATE. Both have the same value, so it
>> doesn't make sense to have both variables. Also, the value is ds which
>> contains the start date of the interval, so the naming didn't make sense to
>> me. However, if anybody argues in favour of adding "start_date" and
>> "end_date" to provide the start and end datetime of task instance
>> intervals, I'd be happy to add them.
>>
>> Cheers,
>> Bas
>>
Re: [DISCUSS] AIRFLOW-4192 - remove duplicate/obsolete/derived task
context variables
Posted by Arthur Wiedmer <ar...@gmail.com>.
Hi Bas,
1) I am aware of a few places where those parameters are used in production
in a few hundred jobs. I highly recommend we don't deprecate them unless we
do it in a major version.
2) As James mentioned, inlets and outlets are a lineage annotation feature
which is still under development. Let's leave them in, but we can guard
them behind a feature flag if you prefer.
3) the yesterday*/tomorrow* params are convenience ones if you use a daily
ETL. I agree with you that they are simple to compute, but not everyone
using Apache Airflow is amazing with Python. Some users are only trying to
get a query scheduled and rely on a couple of niceties like these to get by.
4) latest_date, end_date (I feel like there used to be start_date, but
maybe it got lost) were a blend of things which were used by a backfill
framework used internally at Airbnb. Latest date was used if you needed to
join to a dimension for which you only wanted the latest version of the
attributes in you backfill. end_date was used for time ranges where several
days were processed together in a range to save on compute. I don't see an
issue with removing them.
Best regards,
Arthur
On Mon, Apr 8, 2019 at 5:37 AM Bas Harenslak <ba...@godatadriven.com>
wrote:
> Hi all,
>
> Following Tao Feng’s question to discuss this PR<
> https://github.com/apache/airflow/pull/5010> (AIRFLOW-4192<
> https://issues.apache.org/jira/browse/AIRFLOW-4192>), please discuss here
> if you agree/disagree/would change.
>
> -----------
>
> The summary of the PR:
>
> I was confused by the task context values and suggest to clean up and
> clarify these variables. Some are derivations from other variables, some
> are undocumented and unused, some are wrong (name doesn’t match the value).
> Please discuss what you think of the removal of these variables:
>
>
> * Removed yesterday_ds, yesterday_ds_nodash, tomorrow_ds,
> tomorrow_ds_nodash. IMO the next_* and previous_* variables are useful
> since these require complex logic to compute the next execution date,
> however would leave computing the yesterday* and tomorrow* variables up to
> the user since they are simple one-liners and don't relate to the DAG
> interval.
> * Removed tables. This is a field in params, and is thus also
> accessible by the user ({{ params.tables }}). Also, it was undocumented.
> * Removed latest_date. It's the same as ds and was also undocumented.
> * Removed inlets and outlets. Also undocumented, and have the
> inlets/outlets ever worked/ever been used by anybody?
> * Removed end_date and END_DATE. Both have the same value, so it
> doesn't make sense to have both variables. Also, the value is ds which
> contains the start date of the interval, so the naming didn't make sense to
> me. However, if anybody argues in favour of adding "start_date" and
> "end_date" to provide the start and end datetime of task instance
> intervals, I'd be happy to add them.
>
> Cheers,
> Bas
>