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

Make inferences a separate event #910

Merged
merged 16 commits into from
Aug 31, 2023

Conversation

lrafeei
Copy link
Contributor

@lrafeei lrafeei commented Aug 25, 2023

This PR makes the following changes as requested from MLops team:

  • Each inference is now a separate event. Attach an inference_id to each event.
  • Allow addition of metadata to events
  • Do not automatically convert feature values to string.

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 3 0 5.82s
✅ PYTHON black 6 0 0 1.19s
✅ PYTHON flake8 6 0 0.61s
✅ PYTHON isort 6 0 0 0.25s
✅ PYTHON pylint 6 0 4.59s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop-scikitlearn@00dc996). Click here to learn what that means.
The diff coverage is n/a.

@@                  Coverage Diff                   @@
##             develop-scikitlearn     #910   +/-   ##
======================================================
  Coverage                       ?   81.79%           
======================================================
  Files                          ?      187           
  Lines                          ?    19278           
  Branches                       ?     3309           
======================================================
  Hits                           ?    15769           
  Misses                         ?     2593           
  Partials                       ?      916           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lrafeei lrafeei marked this pull request as ready for review August 29, 2023 21:13
@lrafeei lrafeei requested a review from a team August 29, 2023 21:13
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

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

I've suggested a lot of changes here which might be kinda hard to follow this way so we might wanna just pair on this tomorrow if you would find that easier. Overall pretty good. The major issue is the passing of the metadata and mapping here needs to be done via setting an attribute in the wrapper and then referencing that in the instrumentation instead of trying to pass it through the call stack. It looks like you originally start on the right path in your commit history but then deviated from it in a follow up commit but I think it's a relatively quick fix to adjust it. I've left a note in our channel but I'm considering dropping the mapping addition based on what we discussed in our planning meeting earlier today.

newrelic/hooks/mlmodel_sklearn.py Outdated Show resolved Hide resolved
newrelic/hooks/mlmodel_sklearn.py Outdated Show resolved Hide resolved
newrelic/api/ml_model.py Outdated Show resolved Hide resolved
newrelic/hooks/mlmodel_sklearn.py Outdated Show resolved Hide resolved
newrelic/hooks/mlmodel_sklearn.py Outdated Show resolved Hide resolved
newrelic/hooks/mlmodel_sklearn.py Show resolved Hide resolved
newrelic/core/attribute.py Outdated Show resolved Hide resolved
newrelic/hooks/mlmodel_sklearn.py Outdated Show resolved Hide resolved
tests/mlmodel_sklearn/test_ml_model.py Outdated Show resolved Hide resolved
@lrafeei lrafeei changed the title MLops changes (based on first round reviews) Make inferences a separate event Aug 31, 2023
@hmstepanek hmstepanek merged commit 127ad0c into develop-scikitlearn Aug 31, 2023
43 of 44 checks passed
@hmstepanek hmstepanek deleted the mlops-first-round-edits branch August 31, 2023 23:27
@mergify mergify bot removed the tests-failing label Aug 31, 2023
@umaannamalai umaannamalai added this to the v9.1.0 milestone Sep 14, 2023
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.

4 participants