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

Update protobuf to include instance_id #1881

Merged
merged 7 commits into from
Aug 26, 2024
Merged

Update protobuf to include instance_id #1881

merged 7 commits into from
Aug 26, 2024

Conversation

haakonvt
Copy link
Contributor

@haakonvt haakonvt commented Aug 23, 2024

Description

Updates proto files and also adds the one for insert request (for future possible implementation)

DM-2030

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.52%. Comparing base (4fd3e3a) to head (cf71309).
Report is 6 commits behind head on master.

Files Patch % Lines
...nite/client/_proto/data_point_list_response_pb2.py 25.00% 3 Missing ⚠️
cognite/client/_proto/data_points_pb2.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1881      +/-   ##
==========================================
- Coverage   90.54%   90.52%   -0.02%     
==========================================
  Files         126      126              
  Lines       19481    19483       +2     
==========================================
- Hits        17639    17637       -2     
- Misses       1842     1846       +4     
Files Coverage Δ
cognite/client/_proto/data_points_pb2.py 35.71% <33.33%> (-2.75%) ⬇️
...nite/client/_proto/data_point_list_response_pb2.py 64.70% <25.00%> (ø)

... and 1 file with indirect coverage changes

@haakonvt haakonvt marked this pull request as ready for review August 23, 2024 22:40
@haakonvt haakonvt requested review from a team as code owners August 23, 2024 22:40
@haakonvt haakonvt requested review from roligheten and removed request for a team August 23, 2024 22:40
@haakonvt haakonvt changed the title Update protobuf Update protobuf to include instance_id Aug 25, 2024
Comment on lines +33 to +34
protoc_command = " ".join(("protoc", *FILES, f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}"))
subprocess.run(shlex.split(protoc_command), check=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a bit weird to me first join the command parameters, and then split it again using shlex.

diff --git a/scripts/update_proto_files.py b/scripts/update_proto_files.py
index 2ce4e724..c65f4422 100644
--- a/scripts/update_proto_files.py
+++ b/scripts/update_proto_files.py
@@ -20,7 +20,7 @@ from pathlib import Path
 import requests
 
 URL_BASE = "https://raw.githubusercontent.com/cognitedata/protobuf-files/master/v1/timeseries/"
-FILES = "data_point_list_response.proto", "data_points.proto", "data_point_insertion_request.proto"
+FILES = ["data_point_list_response.proto", "data_points.proto", "data_point_insertion_request.proto"]
 PROTO_DIR = str(Path("cognite/client/_proto").resolve())
 
 
@@ -30,8 +30,8 @@ def download_proto_files_and_compile():
         for file in map(Path, FILES):
             file.touch()
             file.write_bytes(requests.get(f"{URL_BASE}{file}").content)
-        protoc_command = " ".join(("protoc", *FILES, f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}"))
-        subprocess.run(shlex.split(protoc_command), check=True)
+        protoc_command = ["protoc"] + FILES + [f"--python_out={PROTO_DIR}", f"--pyi_out={PROTO_DIR}"]
+        subprocess.run(protoc_command, check=True)
 
 
 def patch_bad_imports():

But this is just a nit.

@haakonvt haakonvt merged commit eab3c97 into master Aug 26, 2024
14 checks passed
@haakonvt haakonvt deleted the update-protobuf branch August 26, 2024 12:29
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