+1 on absolute import. Honestly, a huge fan of doing it as an absolute vs.
relative.

On Wed, Sep 9, 2020 at 4:09 AM Kaxil Naik <kaxiln...@gmail.com> wrote:

> No strong opinion but absolute import seems better from a user's
> perspective.
>
> On Wed, Sep 9, 2020 at 12:07 PM Jarek Potiuk <jarek.pot...@polidea.com>
> wrote:
>
> > +1!
> >
> > On Wed, Sep 9, 2020 at 11:11 AM Ash Berlin-Taylor <a...@apache.org>
> wrote:
> >
> > > Get's my vote, certainly.
> > >
> > > Here's a PR to do it -- https://github.com/apache/airflow/pull/10825
> > >
> > > If no one complains in 24 hours lets merge that.
> > >
> > > On Sep 9 2020, at 9:35 am, Tomasz Urbaszek <
> tomasz.urbas...@polidea.com>
> > > wrote:
> > >
> > > > Hi all,
> > > >
> > > > I would like to spark a (hopefully short) discussion about import
> > > > style in Airflow. In short: absolute vs relative imports.
> > > > Reason for this discussion:
> > > > https://github.com/apache/airflow/pull/10729#discussion_r485419342
> > > >
> > > > Personally I think we should enforce (using pre-commit hook) absolute
> > > > imports in the whole Airflow codebase. We use them already but it's
> > > > not written anywhere that this is a preferred way.
> > > >
> > > > I find absolute imports easier to understand and tremendously helpful
> > > > to understand the structure and interconnections in a codebase. It
> > > > also easier to refactor absolute imports than relative ones. The only
> > > > price of absolute imports is their length
> > > > (airflow.providers.google.cloud.operator.dataproc <3) but I still
> > > > prefere informativeness over amount of code.
> > > >
> > > > What is your opinion on this?
> > > >
> > > > Cheers,
> > > > Tomek
> > > >
> > >
> >
> >
> > --
> >
> > Jarek Potiuk
> > Polidea <https://www.polidea.com/> | Principal Software Engineer
> >
> > M: +48 660 796 129 <+48660796129>
> > [image: Polidea] <https://www.polidea.com/>
> >
>

Reply via email to