Skip to content

Conversation

@edwinpav
Copy link
Contributor

@edwinpav edwinpav commented Nov 3, 2025

Linear issue: https://linear.app/scale-epd/issue/DE-6014

Note: This allows the api_key and limited_access_key to be used together as well as individually (let me know if you think this shouldn't me an option)

Testing:
After updating tests to support limited access keys, all tests that passed before this change still pass via poetry run pytest -q -m "not integration"

Example usage with poetry:

poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(limited_access_key="<LIMITED_ACCESS_KEY>")
print([d.name for d in c.datasets])
PY

# Output
['Test4', 'test_3', 'test2', 'test1']
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(api_key="<API_KEY>", limited_access_key="<LIMITED_ACCESS_KEY>")
print([d.name for d in c.datasets])
PY

# Output
['Test4', 'test_3', 'test2', 'test1']
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(api_key="<API_KEY>")
print([d.name for d in c.datasets])
PY

# Output
['Test4', 'test_3', 'test2', 'test1']
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient()
print([d.name for d in c.datasets])
PY

# Output
nucleus.errors.NoAPIKey: You must provide credentials to NucleusClient: pass api_key or limited_access_key, or set NUCLEUS_API_KEY or NUCLEUS_LIMITED_ACCESS_KEY.

Updated Documentation:

Screenshot 2025-11-14 at 11 03 59 AM

@edwinpav edwinpav self-assigned this Nov 3, 2025
@pytest.mark.skip(
reason="Skip Temporarily - Need to find issue with customObjectIndexingJobId"
)
def test_box_pred_upload_embedding(CLIENT, model_run):
Copy link
Contributor Author

@edwinpav edwinpav Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other test (only 1 other one) that uses customObjectIndexingJobId is also skipped due to an apparently known issue with customObjectIndexingJobId. See here. Thus, this fix should be for a separate pr.

# Important: Don't change this otherwise we will stop testing the earliest
# python version we have to support.
- image: python:3.7-buster
- image: python:3.7-bullseye
Copy link
Contributor Author

@edwinpav edwinpav Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python:3.7-buster was not even building in the circleci pipeline because it seems to be EOL and thus not supported anymore. Please advise if there is a better alternative than the one I chose.

)
"""

def __init__(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will support using both api_key and limited_access_key at the same time. Let me know if it's better to just gate to using one or the other

@vinay553
Copy link
Contributor

Can you include the output above when checking for something that does return if you have a full api key, but not if you only have a limited access key?

@vinay553
Copy link
Contributor

The only failing test here seems to be an unauthorized error?

@edwinpav
Copy link
Contributor Author

The only failing test here seems to be an unauthorized error?

That's a flaky test that occasionally passes/doesn't pass, but I terminated run 4 which was the hanging one so technically doesn't show up as failed:

Screenshot 2025-11-14 at 10 48 39 AM

@edwinpav edwinpav merged commit 671f475 into master Nov 14, 2025
8 checks passed
@edwinpav edwinpav deleted the edwinpav/de-6014-limited-access-key branch November 14, 2025 19:07
@edwinpav
Copy link
Contributor Author

Can you include the output above when checking for something that does return if you have a full api key, but not if you only have a limited access key?

Limited access key means you can only access the Nucleus service with it, so all Nucleus functionality should be available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants