project-codeflare / project-codeflare/codeflare-sdk

guided-demos - simplified import statments not working

Open
#488 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
35
Forks
66
Avg merge
48m
Merged PRs (30d)
7

Description

Describe the Bug

Currently running the notebook as is written results in the following:

#Import pieces from codeflare-sdk
from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication


ImportError Traceback (most recent call last)
Cell In [12], line 4
1 # Import pieces from codeflare-sdk
2 # from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
3 # from codeflare_sdk.cluster.auth import TokenAuthentication
----> 4 from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication

ImportError: cannot import name 'Cluster' from 'codeflare_sdk' (/opt/app-root/lib64/python3.9/site-packages/codeflare_sdk/init.py)

Reverting back to the prior version works fine as intended:

# Import pieces from codeflare-sdk
from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
from codeflare_sdk.cluster.auth import TokenAuthentication

Codeflare Stack Component Versions

Codeflare SDK:

Steps to Reproduce the Bug

Run with simplified imports.

What Have You Already Tried to Debug the Issue?

Tried reinstalling codeflare-sdk via pip.

Expected Behavior

No failure on simplified inputs.

Screenshots, Console Output, Logs, etc.
Affected Releases

Main.

Additional Context

Add as applicable and when known:

Openshift: 4.14.2,
Openshift AI: 2.8.0
CodeFlare Operator: 1.2.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the guided-demos notebook and the installed codeflare_sdk/init.py shown in the traceback, then compare the simplified imports with the working module-level imports. Done means the notebook's simplified import runs without ImportError and the relevant import behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.