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 bug 843531 - DPF: Access violation when DataSource is incorrectly constructed #1146

Merged
merged 7 commits into from
Sep 15, 2023

Conversation

MichaelNale
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #1146 (0c99cf9) into master (b11cdbf) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1146      +/-   ##
==========================================
+ Coverage   87.32%   87.33%   +0.01%     
==========================================
  Files          81       81              
  Lines        9221     9225       +4     
==========================================
+ Hits         8052     8057       +5     
+ Misses       1169     1168       -1     

@@ -61,6 +61,9 @@ def test_print_data_sources(allkindofcomplexity, server_type):


def test_data_sources_from_data_sources(allkindofcomplexity, server_type):
with pytest.raises(ValueError) as e:
data_sources_false = dpf.core.DataSources(data_sources="Wrong Input", server=server_type)
assert "Data source must be gRPC data sources message type" in e
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: if I were you, I would just assert that "gRPC" data sources" substring is contained in the error message.

@@ -77,9 +78,12 @@ def __init__(self, result_path=None, data_sources=None, server=None):
self._internal_obj = core_api.data_processing_duplicate_object_reference(
data_sources
)
else:
elif hasattr(data_sources, "DESCRIPTOR") or isinstance(data_sources, int):
Copy link
Contributor

@anslpa anslpa Sep 14, 2023

Choose a reason for hiding this comment

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

You could also use if (hasattr(data_sources, "module") and (data_sources.module == 'data_sources_pb2'))

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: int is for the case CLayer server, ctypes.c_void_p is returned (which is an int)

@MichaelNale MichaelNale merged commit a4cd322 into master Sep 15, 2023
27 of 28 checks passed
@MichaelNale MichaelNale deleted the fix/data_sources_message branch September 15, 2023 14:42
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.

3 participants