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

Refine BybitEnumParser for Bybit #2107

Merged

Conversation

sunlei
Copy link
Collaborator

@sunlei sunlei commented Dec 14, 2024

Pull Request

Refine BybitEnumParser for Bybit.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

Tests added.

Copy link

codspeed-hq bot commented Dec 14, 2024

CodSpeed Performance Report

Merging #2107 will not alter performance

Comparing sunlei:sunlei/bybit-refine-enum-parser (fa96783) with develop (b1e06cc)

Summary

✅ 52 untouched benchmarks

Copy link
Member

@cjdsellers cjdsellers left a comment

Choose a reason for hiding this comment

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

Many thanks! @sunlei

@@ -537,50 +554,27 @@ def parse_bybit_order_type(
def parse_nautilus_time_in_force(self, time_in_force: TimeInForce) -> BybitTimeInForce:
try:
return self.nautilus_to_bybit_time_in_force[time_in_force]
except KeyError:
except KeyError as exec:
Copy link
Member

Choose a reason for hiding this comment

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

To align with Rust, we standardized on using as e for the exception variable name. (I'll refactor this after merging.)

@@ -145,3 +147,62 @@ def test_parse_nautilus_order_side(
# ) -> None:
# result = self._enum_parser.parse_nautilus_order_status(order_status)
# assert result == bybit_order_status

@pytest.mark.parametrize(
Copy link
Member

Choose a reason for hiding this comment

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

Amazing, thank you 🙏

@cjdsellers cjdsellers merged commit f483b6f into nautechsystems:develop Dec 14, 2024
11 checks passed
@sunlei sunlei deleted the sunlei/bybit-refine-enum-parser branch December 15, 2024 07:11
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.

2 participants