The best way to debug is to use ipdb debugger or remote debugging feature
from PyCharm/IntelliJ.

* For the first one ipdb - there is a note in upcoming Docker CI image
environment:
https://github.com/PolideaInternal/airflow/blob/ms-travis-ci-tests/CONTRIBUTING.md#running-individual-tests
.
You can set the ipdb trace method in any place of the python code you have
and you should be able to debug from the console.

* For remote debugging it is a bit more difficult and requires paid version
of PyCharm/IntelliJ - I have another PR that I am going to propose soon -
the Breeze environment and you can find description on how to setup remote
debugging here:
https://github.com/PolideaInternal/airflow/blob/simplified-development-workflow/BREEZE.rst#debugging-airflow-breeze-tests-in-ide


Additionally Pycharm/IntelliJ allow you to debug various templates
(including Jinja templates). You can likely combine this with remote
debugging but I have never used it this way):
https://blog.jetbrains.com/pycharm/2017/06/template-debugging/

J.

On Tue, Jul 16, 2019 at 9:23 PM Shaw, Damian P. <
[email protected]> wrote:

> Hi all,
>
> I've just been working on updating many of my macros to include logic to
> handle holiday calendars. There was a small mistake in one of the macros
> and I found it very difficult to debug, I'm not sure where a default logger
> in the plugins would log out to and there was no obvious way to run the
> code outside of airflow or somewhere I could add a breakpoint.
>
> My issue is solved now, but does anyone have an advise on how to debug
> Macros or Plugins for future cases?
>
> Thanks,
> Damian
>
> ===============================================================================
>
> Please access the attached hyperlink for an important electronic
> communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===============================================================================
>
>


-- 

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