You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/12/26 22:35:21 UTC

[GitHub] [beam] ahmedabu98 opened a new pull request, #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

ahmedabu98 opened a new pull request, #24783:
URL: https://github.com/apache/beam/pull/24783

   Implementing a wrapper for Python SDK that uses the Storage API SchemaTransform (#23988) to write to BigQuery


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093490259


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -691,6 +692,12 @@ public static Row toBeamRow(Schema rowSchema, TableSchema bqSchema, TableRow jso
       if (JSON_VALUE_PARSERS.containsKey(fieldType.getTypeName())) {
         return JSON_VALUE_PARSERS.get(fieldType.getTypeName()).apply(jsonBQString);
       } else if (fieldType.isLogicalType(SqlTypes.DATETIME.getIdentifier())) {
+        // Handle if datetime value is in micros

Review Comment:
   > Does BQ support both these formats ?
   
   These changes support converting DateTime values expressed in micros to Beam value (LocalDateTime --> [DateTime logical type](https://github.com/apache/beam/blob/7a6598f2c96397dd47c69cc21600d778e395a0a5/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/DateTime.java#L41)). Was necessary to add because Storage Write API returns failed TableRows with micros DateTime values, so was running into issues converting them to Beam Rows to output in DLQ. In any case (String or Long) they are converted to LocalDateTime object.
   
   > Also, let's add a log to the catch clause justifying swelling the exception here.
   
   Wouldn't this be problematic with large writes? It would log for every row with a DateTime in String format.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420791808

   Run Python 3.10 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1419405386

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] chamikaramj commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093555982


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -691,6 +692,12 @@ public static Row toBeamRow(Schema rowSchema, TableSchema bqSchema, TableRow jso
       if (JSON_VALUE_PARSERS.containsKey(fieldType.getTypeName())) {
         return JSON_VALUE_PARSERS.get(fieldType.getTypeName()).apply(jsonBQString);
       } else if (fieldType.isLogicalType(SqlTypes.DATETIME.getIdentifier())) {
+        // Handle if datetime value is in micros

Review Comment:
   Thanks for the explanation.
   
   Sorry, by log, I meant a comment :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] chamikaramj commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1088485772


##########
sdks/python/apache_beam/transforms/external.py:
##########
@@ -367,6 +367,32 @@ def discover(expansion_service):
             inputs=proto_config.input_pcollection_names,
             outputs=proto_config.output_pcollection_names)
 
+  @staticmethod
+  def discover_one(expansion_service, name):

Review Comment:
   How about "discover_config()" ?



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -691,6 +692,12 @@ public static Row toBeamRow(Schema rowSchema, TableSchema bqSchema, TableRow jso
       if (JSON_VALUE_PARSERS.containsKey(fieldType.getTypeName())) {
         return JSON_VALUE_PARSERS.get(fieldType.getTypeName()).apply(jsonBQString);
       } else if (fieldType.isLogicalType(SqlTypes.DATETIME.getIdentifier())) {
+        // Handle if datetime value is in micros

Review Comment:
   Does BQ support both these formats ?
   
   Also, let's add a log to the catch clause justifying swelling the exception here.



##########
sdks/python/apache_beam/transforms/external.py:
##########
@@ -367,6 +367,32 @@ def discover(expansion_service):
             inputs=proto_config.input_pcollection_names,
             outputs=proto_config.output_pcollection_names)
 
+  @staticmethod
+  def discover_one(expansion_service, name):
+    """Discover one SchemaTransform by name in the given expansion service.

Review Comment:
   Can we add a unit test for this one with a mock service ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420814330

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1433866378

   Run XVR_PythonUsingJava_Dataflow PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1416102038

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1419405488

   Run Python 3.10 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] codecov[bot] commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1365499734

   # [Codecov](https://codecov.io/gh/apache/beam/pull/24783?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#24783](https://codecov.io/gh/apache/beam/pull/24783?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dbc4900) into [master](https://codecov.io/gh/apache/beam/commit/2b746d1d2173a2241e0f4a5a3cd5b105d10340de?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2b746d1) will **decrease** coverage by `0.10%`.
   > The diff coverage is `30.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #24783      +/-   ##
   ==========================================
   - Coverage   73.34%   73.24%   -0.11%     
   ==========================================
     Files         721      725       +4     
     Lines       97224    97474     +250     
   ==========================================
   + Hits        71313    71393      +80     
   - Misses      24561    24731     +170     
     Partials     1350     1350              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | python | `82.81% <30.00%> (-0.19%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/beam/pull/24783?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [sdks/python/apache\_beam/transforms/external.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9leHRlcm5hbC5weQ==) | `77.12% <16.66%> (-1.77%)` | :arrow_down: |
   | [sdks/python/apache\_beam/io/gcp/bigquery.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vZ2NwL2JpZ3F1ZXJ5LnB5) | `70.68% <38.88%> (-0.66%)` | :arrow_down: |
   | [sdks/python/apache\_beam/utils/interactive\_utils.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdXRpbHMvaW50ZXJhY3RpdmVfdXRpbHMucHk=) | `95.12% <0.00%> (-2.44%)` | :arrow_down: |
   | [.../python/apache\_beam/transforms/periodicsequence.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9wZXJpb2RpY3NlcXVlbmNlLnB5) | `97.01% <0.00%> (-1.50%)` | :arrow_down: |
   | [...eam/runners/portability/fn\_api\_runner/execution.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9wb3J0YWJpbGl0eS9mbl9hcGlfcnVubmVyL2V4ZWN1dGlvbi5weQ==) | `92.49% <0.00%> (-0.64%)` | :arrow_down: |
   | [sdks/python/apache\_beam/transforms/combiners.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9jb21iaW5lcnMucHk=) | `93.05% <0.00%> (-0.39%)` | :arrow_down: |
   | [...hon/apache\_beam/runners/worker/bundle\_processor.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy93b3JrZXIvYnVuZGxlX3Byb2Nlc3Nvci5weQ==) | `93.67% <0.00%> (ø)` | |
   | [...hon/apache\_beam/testing/analyzers/perf\_analysis.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9hbmFseXplcnMvcGVyZl9hbmFseXNpcy5weQ==) | `17.39% <0.00%> (ø)` | |
   | [...ache\_beam/testing/analyzers/github\_issues\_utils.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9hbmFseXplcnMvZ2l0aHViX2lzc3Vlc191dGlscy5weQ==) | `49.05% <0.00%> (ø)` | |
   | [...ache\_beam/testing/analyzers/perf\_analysis\_utils.py](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdGVzdGluZy9hbmFseXplcnMvcGVyZl9hbmFseXNpc191dGlscy5weQ==) | `25.71% <0.00%> (ø)` | |
   | ... and [3 more](https://codecov.io/gh/apache/beam/pull/24783/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] github-actions[bot] commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1397656213

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] chamikaramj commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093557618


##########
sdks/python/apache_beam/transforms/external.py:
##########
@@ -367,6 +367,32 @@ def discover(expansion_service):
             inputs=proto_config.input_pcollection_names,
             outputs=proto_config.output_pcollection_names)
 
+  @staticmethod
+  def discover_one(expansion_service, name):
+    """Discover one SchemaTransform by name in the given expansion service.
+
+    :return: one SchemaTransformConfig that represents the discovered

Review Comment:
   Also, mention what the function would do if the transform is not found.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420791594

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1421149821

   Run Python 3.10 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1434964969

   Closing this PR in favor of #25521 as this one has gotten too messy.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by GitBox <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1397604536

   R: @chamikaramj 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093490259


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -691,6 +692,12 @@ public static Row toBeamRow(Schema rowSchema, TableSchema bqSchema, TableRow jso
       if (JSON_VALUE_PARSERS.containsKey(fieldType.getTypeName())) {
         return JSON_VALUE_PARSERS.get(fieldType.getTypeName()).apply(jsonBQString);
       } else if (fieldType.isLogicalType(SqlTypes.DATETIME.getIdentifier())) {
+        // Handle if datetime value is in micros

Review Comment:
   > Does BQ support both these formats ?
   
   These changes support converting DateTime values expressed in micros to Beam value (LocalDateTime --> [DateTime logical type](https://github.com/apache/beam/blob/7a6598f2c96397dd47c69cc21600d778e395a0a5/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/DateTime.java#L41)). Was necessary to add because Storage Write API returns failed TableRows with micros DateTime values, so was running into issues converting them to Beam Rows to output in DLQ. In any case (String or Long) they are converted to LocalDateTime object.
   
   > Also, let's add a log to the catch clause justifying swelling the exception here.
   
   Wouldn't this be problematic with large writes? It would log for every row with a DateTime in String format. The try-catch block here is just to check if the value is a number, maybe there's a better way to do it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1416101939

   Run Python 3.8 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1421149966

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093490259


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -691,6 +692,12 @@ public static Row toBeamRow(Schema rowSchema, TableSchema bqSchema, TableRow jso
       if (JSON_VALUE_PARSERS.containsKey(fieldType.getTypeName())) {
         return JSON_VALUE_PARSERS.get(fieldType.getTypeName()).apply(jsonBQString);
       } else if (fieldType.isLogicalType(SqlTypes.DATETIME.getIdentifier())) {
+        // Handle if datetime value is in micros

Review Comment:
   > Does BQ support both these formats ?
   
   These changes support converting DateTime values expressed in micros to Beam value (LocalDateTime --> [DateTime logical type](https://github.com/apache/beam/blob/7a6598f2c96397dd47c69cc21600d778e395a0a5/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/DateTime.java#L41)). Was necessary to add because Storage Write API returns failed TableRows with micros DateTime values, so was running into issues converting them to Beam Rows to output in DLQ. In any case (String or Long) they are converted to LocalDateTime object.
   
   > Also, let's add a log to the catch clause justifying swelling the exception here.
   
   Wouldn't this be problematic with large writes? It would log for every row with a DateTime in String format, which is more common.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1093496497


##########
sdks/python/apache_beam/transforms/external.py:
##########
@@ -367,6 +367,32 @@ def discover(expansion_service):
             inputs=proto_config.input_pcollection_names,
             outputs=proto_config.output_pcollection_names)
 
+  @staticmethod
+  def discover_one(expansion_service, name):

Review Comment:
   sure SGTM



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 closed pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 closed pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK
URL: https://github.com/apache/beam/pull/24783


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420978155

   Run Python 3.10 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420978036

   Run Python 3.7 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1420814192

   Run Python 3.10 PostCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] chamikaramj commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1405878343

   Did you try triggering the Jenkins integration test suites for the test with this PR ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] ahmedabu98 commented on pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #24783:
URL: https://github.com/apache/beam/pull/24783#issuecomment-1413905091

   @chamikaramj let me know if the mock service unit test is along the lines of what you were thinking


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] chamikaramj commented on a diff in pull request #24783: BigQuery Storage Write API SchemaTransform wrapper for Python SDK

Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on code in PR #24783:
URL: https://github.com/apache/beam/pull/24783#discussion_r1095266155


##########
sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py:
##########
@@ -545,6 +548,102 @@ def test_big_query_write_temp_table_append_schema_update(self, file_format):
               temp_file_format=file_format))
 
 
+class BigQueryXlangStorageWriteIT(unittest.TestCase):
+  BIGQUERY_DATASET = 'python_xlang_write_'
+
+  ELEMENTS = [
+      # (int, float, string, timestamp, bool, bytes)
+      (
+          1,
+          0.1,
+          'a',
+          Timestamp(seconds=100, micros=10),
+          False,
+          bytes('a', 'utf-8')),
+      (
+          2,
+          0.2,
+          'b',
+          Timestamp(seconds=200, micros=20),
+          True,
+          bytes('b', 'utf-8')),
+      (
+          3,
+          0.3,
+          'c',
+          Timestamp(seconds=300, micros=30),
+          False,
+          bytes('c', 'utf-8')),
+      (
+          4,
+          0.4,
+          'd',
+          Timestamp(seconds=400, micros=40),
+          True,
+          bytes('d', 'utf-8')),
+  ]
+
+  def setUp(self):
+    self.test_pipeline = TestPipeline(is_integration_test=True)
+    self.project = self.test_pipeline.get_option('project')
+
+    self.bigquery_client = BigQueryWrapper()
+    self.dataset_id = '%s%s%d' % (
+        self.BIGQUERY_DATASET, str(int(time.time())), random.randint(0, 10000))
+    self.bigquery_client.get_or_create_dataset(self.project, self.dataset_id)
+    _LOGGER.info(
+        "Created dataset %s in project %s", self.dataset_id, self.project)
+
+    self.expansion_service = ('localhost:%s' % os.environ.get('EXPANSION_PORT'))

Review Comment:
   We should be using this expansion service when running the pipeline ?
   
   Also, does this service already get created ? 
   
   
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org