Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added expand flag to stringify_unsupported() to expand series #1862

Merged
merged 10 commits into from
Oct 31, 2024

Conversation

SiddhantSadangi
Copy link
Member

@SiddhantSadangi SiddhantSadangi commented Aug 21, 2024

Before submitting checklist

stringify_unsupported() does not currently expand lists, casting them to string instead.

For dicts that contain lists as values, as shown below

nested_dict = {
    "name": "John Doe",
    "age": 30,
    "is_employee": True,
    "address": {"street": "123 Main St", "city": "Anytown", "postal_code": "12345"},
    "projects": [
        {"name": "Project Alpha", "status": "completed", "budget": 100000},
        {"name": "Project Beta", "status": "in progress", "budget": 150000},
    ],
    "skills": ["Python", "Data Analysis", "Machine Learning"],
    "employment_history": [
        {"company": "Company A", "position": "Data Scientist", "years": 3},
        {"company": "Company B", "position": "Software Engineer", "years": 2},
    ],
}

this leads to keys like projects, skills, and employment_history being logged as a string
image
Example

This makes it harder to find relevant information if it is nested as a list in a dict, and also makes it a lot harder to download such metadata from Neptune, as it would be downloaded as a string.

This PR adds an optional expand flag to stringify_unsupported() to expand series like lists, sets, and tuples thereby storing nested values in their proper folder structure within enumerated folders, making it easier to both search for metadata and download it.
image
Example

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you ask the docs owner to review all the user-facing changes?

@SiddhantSadangi SiddhantSadangi marked this pull request as ready for review October 28, 2024 16:07
@SiddhantSadangi SiddhantSadangi changed the title feat: stringify_unsupported() now expands lists feat: Added expand flag to stringify_unsupported() to expand series Oct 28, 2024
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.59%. Comparing base (7da7535) to head (c0f65f2).
Report is 1 commits behind head on dev/1.x.

Additional details and impacted files
@@             Coverage Diff             @@
##           dev/1.x    #1862      +/-   ##
===========================================
- Coverage    77.56%   75.59%   -1.97%     
===========================================
  Files          303      303              
  Lines        15382    15366      -16     
===========================================
- Hits         11931    11616     -315     
- Misses        3451     3750     +299     
Flag Coverage Δ
e2e ?
e2e-management ?
e2e-s3 ?
e2e-s3-gcs ?
macos 75.27% <100.00%> (-2.02%) ⬇️
py3.10 ?
py3.11 ?
py3.12 ?
py3.8 75.59% <100.00%> (-1.93%) ⬇️
py3.9 ?
ubuntu 75.41% <100.00%> (-2.02%) ⬇️
unit 75.59% <100.00%> (-0.04%) ⬇️
windows 74.50% <100.00%> (-1.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kgodlewski kgodlewski left a comment

Choose a reason for hiding this comment

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

I think we just need a better explanation, apart from that LGTM

src/neptune/utils.py Outdated Show resolved Hide resolved
kgodlewski
kgodlewski previously approved these changes Oct 29, 2024
Copy link
Contributor

@kgodlewski kgodlewski left a comment

Choose a reason for hiding this comment

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

Let's wait for @normandy7's approval then it's good to merge

CHANGELOG.md Outdated Show resolved Hide resolved
src/neptune/utils.py Outdated Show resolved Hide resolved
src/neptune/utils.py Outdated Show resolved Hide resolved
@SiddhantSadangi SiddhantSadangi merged commit 0dc2ea0 into dev/1.x Oct 31, 2024
4 checks passed
@SiddhantSadangi SiddhantSadangi deleted the ss/stringify_unsupported branch October 31, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants