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

fix(anomaly): ensure correct data types #1077

Merged
merged 1 commit into from
Aug 8, 2022
Merged

Conversation

Samyak2
Copy link
Contributor

@Samyak2 Samyak2 commented Aug 5, 2022

Summary

The empty prediction dataframe is now given the correct types immediately after creation. This ensures that any data appended to the dataframe will have the correct type. Note: if the columns or the dataframe itself is overwritten, this will not hold and the types may change.

Also uses a simpler method to get the last row of the prediction dataframe which prevents loss of types. The earlier version would erase all the metadata and make the dtypes object.

These 2 changes ensure that the y column is always a float and the dataframe correctly identifies it as such. Note: the columns can still be overriden by some other code and this cannot be ensured without writing tests.

TODO

  • Test public KPIs - initial run
  • Test public KPIs - subsequent run
  • Test KPI with integer metric column - initial run
  • Test KPI with integer metric column - subsequent run
  • Compare outputs of previous code and new code for each case

The empty prediction dataframe is now given the correct types
immediately after creation. This ensures that any data appended to the
dataframe will have the correct type. Note: if the columns or the
dataframe itself is overwritten, this will not hold and the types may
change.

Also uses a simpler method to get the last row of the prediction
dataframe which prevents loss of types. The earlier version would erase
all the metadata and make the dtypes `object`.

These 2 changes ensure that the `y` column is always a `float` and the
dataframe correctly identifies it as such. Note: the columns can still
be overriden by some other code and this cannot be ensured without
writing tests.
@Samyak2 Samyak2 added 🐛 bug Something isn't working 🛠️ backend labels Aug 5, 2022
@Samyak2 Samyak2 added this to the v0.10.1 milestone Aug 5, 2022
@gitpod-io
Copy link

gitpod-io bot commented Aug 5, 2022

@netlify
Copy link

netlify bot commented Aug 5, 2022

Deploy Preview for frontend-sb ready!

Name Link
🔨 Latest commit e0327d8
🔍 Latest deploy log https://app.netlify.com/sites/frontend-sb/deploys/62ecfa2ffeecc6000845d957
😎 Deploy Preview https://deploy-preview-1077--frontend-sb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@Amatullah Amatullah left a comment

Choose a reason for hiding this comment

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

Tested locally. LGTM.

@Samyak2 Samyak2 merged commit fbb0a01 into develop Aug 8, 2022
@Samyak2 Samyak2 deleted the fix/data-types-in-anomaly branch August 8, 2022 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ backend 🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants