question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request documentation on best practises when debugging kedro cli commands in a pycharm environment

See original GitHub issue

Introduction

I am trying to generate a project using kedro new --starter and see a cookiecutter error that I would like to investigate in more detail by stepping through the code line by line

Background

Being able to step inside the code is invaluable for better understand the error.

Problem

There’s a lot of code to work through to get to the core functionality that actually creates the new project repo using the commands we pass on the cli. I’m unable to access those functions directly because then a number of initialization steps are not present. For example, context is missing, so on.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
AntonyMilneQBcommented, Jul 1, 2021

Hi @roumail, I’ve reworked the implementation of kedro new --starter quite a bit recently so would be curious to hear what the problem is here. To debug it while developing, my approach is to set up a run configuration as per this guide to run kedro new --starter. You can put PyCharm breakpoints in the source code of kedro in site-packages and it should still work. Alternatively, if you want to have it more easily accessible you can pip install kedro --target=. --no-deps to install it into your current working directory rather than site-packages.

To get started you’ll want to put your first breakpoint in kedro.framework.cli.starters.new, which is the function that gets called when kedro new is executed. Let me know if you need a hand following the flow after that - I know it well since I just rewrote lots of it.

1reaction
datajoelycommented, Jul 1, 2021

Hi @roumail do you want to join us on Discord and it will be easier to debug? https://discord.gg/akJDeVaxnB

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up PyCharm — Kedro 0.18.4 documentation
Set up PyCharm¶. This section will present a quick guide on how to configure PyCharm as a development environment for working on Kedro...
Read more >
PyCharm - Run/Debug Configuration: Python - JetBrains
Use this dialog to create a run/debug configuration for Python scripts. ... In this field, specify the command-line options to be passed to...
Read more >
How to setup PyCharm with Kedro - YouTube
Data Engineering is a tough job, and it can be made tougher by complex, difficult to understand data pipelines. In this series, we...
Read more >
[KED-2536] `kedro ipython` and `kedro jupyter` are broken if ...
Our main need is to have a way to reliably load the context inside an ipython or jupyter notebook environment, and with your...
Read more >
Python Debugging With Pdb
In this hands-on tutorial, you'll learn the basics of using pdb, Python's interactive source code debugger. Pdb is a great tool for tracking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found