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

Use C# generic history api for custom Python universe #8610

Conversation

jhonabreul
Copy link
Collaborator

Description

Cache custom universe and security Python data types in order to be able to get the correct config for history requests when pythonnet resolves custom data types to PythonData for generic arguments, causing loss of reference of the actual Python type.

Related Issue

Closes #8477

Motivation and Context

Requires Documentation Change

How Has This Been Tested?

Unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Use this cache to get the correct config for history requests since pythonnet will always pass PythonData and we lose reference to the actual Python type
@@ -1141,9 +1141,15 @@ private IEnumerable<SubscriptionDataConfig> GetMatchingSubscriptions(Symbol symb
var isCustom = Extensions.IsCustomDataType(symbol, type);
var entry = MarketHoursDatabase.GetEntry(symbol, new[] { type });

// If the type is PythonData, we want to check what types are actually associated with the symbol
if (!_customPythonDataTypes.TryGetValue(symbol, out var dataType))
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the dataType already be available in an existing config above, believe handling those correctly might avoid the need this new cache

@Martin-Molinero
Copy link
Member

Closing for now, solution should also consider C# use case, ideally standardized with existing code paths, seems this would only cover the python API

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.

History request for custom universe objects
2 participants