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.

Simplify api hierarchy

See original GitHub issue

Description

When using kedro as a user it can sometimes be hard to remember where even the most common kedro features are located.

Context

This will lower the barrier to entry to using kedro, and make it easier to use without needing to use the docs for even the most simple task such as “How do I make a node”.

Possible Implementation

To simplify the barrier to entry into kedro import the most commonly used features right into main.

WARNING - for the person browsing through, this is not the real api, this is simply a suggestion.

import kedro as kd

my_pipeline = kd.Pipeline([kd.node(create_cars, None, "cars")])

Alternatively users can also use the same api as so.

from kedro import Pipeline, node

my_pipeline = Pipeline([node(create_cars, None, "cars")])

At a minimum I feel that the very core features that every kedro user needs should be at the top of the api.

  • Pipeline
  • node

The next priority would be those used by hooks authors.

  • KedroSession
  • ConfigLoader

Finally the full scope of what should be considered to be made easy to reach should be every occurance of from kedro import x in the project template.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
noklamcommented, Aug 26, 2022

If you do from kedro import … , would it import everything under this path? This wouldn’t be desirable so we need to investigate if this is the case.

I am pretty sure this is the case and it’s just how Python works, and there isn’t much we can do here.

For example if you have a __init__.py which just has 1 line.

import kedro.xxx.yyy.zzz

Everytime you do import kedro, it will also import kedro.xxx and kedro.xxx.yyy and kedro.xxx.yyy.zzz. Equally when people do from xxx.yyy.zzz import something, it doesn’t save any memory magically as the top-level library is imported, it just import it into a local namespace and optionally have an alias.

Direct Import

image

From import

image

2reactions
limdautocommented, Jul 1, 2022

A bit off topic but @noklam if you are interested in IDE/Notebook tooling I had this project that I haven’t found the time to develop further: https://github.com/Kedro-Zero-to-Hero/kedro-lsp – if you are interested, pls let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[#SPARK-20649] Simplify REST API class hierarchy - ASF JIRA
This task tracks simplifying the REST API hierarchy. ... the REST API will be deleted as part of the UI work (see SPARK-20648,...
Read more >
com.vividsolutions.jts.simplify Class Hierarchy (JTS Topology Suite ...
Class Hierarchy. java.lang.Object. com.vividsolutions.jts.simplify.DouglasPeuckerSimplifier; com.vividsolutions.jts.simplify.
Read more >
Hierarchy For Package org.locationtech.jts.simplify
Package Hierarchies: All Packages. Class Hierarchy. java.lang.Object. org.locationtech.jts.simplify.DouglasPeuckerSimplifier; org.locationtech.jts.simplify.
Read more >
Simplifying complex class hierarchy - python - Stack Overflow
But has several commonly used solutions. One of them - SOLID principles in design. So you haven't to search functionality trough the levels...
Read more >
Class Hierarchy - SimplyBlu
Class Hierarchy · simplify.Authentication: Holds authentication information used when accessing the API. · simplify.constants.Constants: Holds constant values.
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