-
Notifications
You must be signed in to change notification settings - Fork 185
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
bug fix for float in historical data #641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary by Korbit AI
Code Health Comments
- Log the original exception to preserve error information for debugging before raising a new ValueError.
Files scanned
File Path | Reviewed |
---|---|
setup.py | ✅ |
lumibot/data_sources/pandas_data.py | ✅ |
lumibot/entities/data.py | ✅ |
lumibot/strategies/strategy.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ✅ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
except Exception as e: | ||
raise ValueError( | ||
f"Invalid length parameter in get_historical_prices() method. Length must be an int but instead got {length}, " | ||
f"which is a type {type(length)}." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log the original exception before raising a new one.
Tell me more
Consider logging the original exception before raising a new one. This can help with debugging by preserving the original error information. You could add a log statement before raising the ValueError.
I just unsubscribed 4 eamils and i still got this eamil! please help.
…On Fri, Nov 29, 2024 at 7:11 PM korbit-ai[bot] ***@***.***> wrote:
***@***.***[bot]* commented on this pull request.
Review Summary by Korbit AI Code Health Comments
- Log the original exception to preserve error information for
debugging before raising a new ValueError.
Files scanned
File Path Reviewed
setup.py ✅
lumibot/data_sources/pandas_data.py ✅
lumibot/entities/data.py ✅
lumibot/strategies/strategy.py ✅
Explore our documentation <https://docs.korbit.ai> to understand the
languages and file types we support
<https://docs.korbit.ai/configuration/supported-languages> and the files
we ignore <https://docs.korbit.ai/configuration/ignoring-files>.
Need a new review? Comment /korbit-review on this PR and I'll review your
latest changes.
Korbit Guide: Usage and Customization Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review command in a comment at the root of your PR.
- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description command in any comment on your PR.
- Too many Korbit comments? I can resolve all my comment threads if
you use the /korbit-resolve command in any comment on your PR.
- Chat with Korbit on issues we post by tagging @korbit-ai
<https://github.com/korbit-ai> in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on
the comments Korbit posts.
Customizing Korbit
- Check out our docs
<https://docs.korbit.ai/configuration/organization-settings> on how
you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console
<https://app.korbit.ai/a18b7e63-743d-4f50-b9b5-cb58f1beb0f3/settings>.
Current Korbit Configuration General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions ✅ Issue Categories
Category Enabled
Naming ✅
Database Operations ✅
Documentation ✅
Logging ✅
Error Handling ✅
Systems and Environment ✅
Objects and Data Structures ✅
Readability and Maintainability ✅
Asynchronous Processing ✅
Design Patterns ✅
Third-Party Libraries ✅
Performance ✅
Security ✅
Functionality ✅ Feedback and Support
- Tell us what you think of Korbit
<https://rfn13ctpmt0.typeform.com/to/DOoeLyoN>
- Schedule a call with our team
<https://meetings.salesloft.com/korbittechnologies/korbitai>
- Email us @ ***@***.***
------------------------------
In lumibot/strategies/strategy.py
<#641 (comment)>:
> + except Exception as e:
+ raise ValueError(
+ f"Invalid length parameter in get_historical_prices() method. Length must be an int but instead got {length}, "
+ f"which is a type {type(length)}."
+ )
[image: category Error Handling]
<https://camo.githubusercontent.com/ed4c5c8db2dd9e8ef50ba292adf638aa48d21523b04e8dc3023e43768af3a133/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63617465676f72792d4572726f7225323048616e646c696e672d626c7565> [image:
severity potentially major]
<https://camo.githubusercontent.com/581de1d5b8f97ef021bd5e7c8992f0a31fd957c5ef628e2f23c87e70874ff9e9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f74656e7469616c6c792532304d616a6f722d726564>
*Log the original exception before raising a new one.*
Tell me more
Consider logging the original exception before raising a new one. This can
help with debugging by preserving the original error information. You could
add a log statement before raising the ValueError.
Chat with Korbit by mentioning @korbit-ai <https://github.com/korbit-ai>,
and give a 👍 or 👎 to help Korbit improve your reviews.
—
Reply to this email directly, view it on GitHub
<#641 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIOKVG4SZ4AHNIDVU6ITEQ32DCU5XAVCNFSM6AAAAABSXRXQ2GVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINZQGM4DKNJXGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@Syntax-Sorcerer87 I am looking at your pull request. The description will be updated shortly. In the meantime, please do not edit the description until I have finished writing mine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary by Korbit AI
Code Health Comments
- Log the original exception before raising a new one to improve debugging and error context.
Files scanned
File Path | Reviewed |
---|---|
setup.py | ✅ |
lumibot/data_sources/pandas_data.py | ✅ |
lumibot/entities/data.py | ✅ |
lumibot/strategies/strategy.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ✅ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
except Exception as e: | ||
raise ValueError( | ||
f"Invalid length parameter in get_historical_prices() method. Length must be an int but instead got {length}, " | ||
f"which is a type {type(length)}." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log exceptions before raising a new one.
Tell me more
When catching an exception, it's a good practice to log the error before raising a new exception. This helps with debugging by providing more context about the original error. Consider logging the original exception before raising the ValueError.
Description by Korbit AI
What change is being made?
Implement type-checking for the
length
parameter in theget_historical_prices
function to ensure it is an integer, and update the package version insetup.py
from 3.8.14 to 3.8.15.Why are these changes being made?
The update addresses a bug where non-integer values for the
length
parameter in historical data retrieval could cause unexpected behavior, improving robustness by attempting to cast it to an integer and raising a meaningful error if casting fails. Incrementing the version number reflects this bug fix, improving package maintainability and version tracking.