Skip to content

Refine databento request_instruments granularity #2347

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

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

faysou
Copy link
Collaborator

@faysou faysou commented Feb 22, 2025

Pull Request

Add possibility to choose which instrument ids to request in request_instrument_ids for example [""ES.OPT", "ES.FUT""] as instrument_ids

Uses the params feature that makes it very easy to customize adapters

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested?

Not tested, uses the fact that get_range_instruments can take a list as argument

@@ -440,7 +440,7 @@ async def _subscribe_instruments(self, command: SubscribeInstruments) -> None:
async def _subscribe_instrument(self, command: SubscribeInstrument) -> None:
try:
dataset: Dataset = self._loader.get_dataset_for_venue(command.instrument_id.venue)
start: int | None = command.params.get("start") if command.params else None
start = command.params.get("start")
Copy link
Member

Choose a reason for hiding this comment

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

I think any time we access dict[str, Any] we should use inline type annotations. This helps static analyzers, and declares the expected type to prevent downstream bugs.

@faysou faysou force-pushed the databentoinstruments branch from 61cf327 to c095490 Compare February 22, 2025 22:25
@faysou faysou force-pushed the databentoinstruments branch from c095490 to 9ebba7f Compare February 22, 2025 22:30
@cjdsellers cjdsellers merged commit 450a8db into develop Feb 23, 2025
13 checks passed
@cjdsellers cjdsellers deleted the databentoinstruments branch February 23, 2025 00:08
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