Shared libraries in recipes and notebooks

Options
tomas
tomas Registered, Neuron 2022 Posts: 120 ✭✭✭✭✭
Is it possible to use a project level shared python library and global shared library with the same name in a python recipe/notebook.

How does DSS resolves different versions of the same function?

Answers

  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    edited July 17
    Options

    Hi,

    If you create a project-level python library with the same name as a global-level python library, the global-level will be used. Hence it is best to have different names for python files and/or directory structure at project-level and global-level.

    Since you can have a directory structure in these libraries, you can define your own submodule structure to customize the name resolution. For instance, you can create a directory named "global_lib" inside the global python-lib directory. You could then advise users to put all global-level library files inside the former directory. Then from a Python notebook inside a project, they would reference the global module with:


    from global_lib.foo import bar

    Cheers,

    Alex

Setup Info
    Tags
      Help me…