You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damondouglas (via GitHub)" <gi...@apache.org> on 2023/02/10 05:37:35 UTC

[GitHub] [beam] damondouglas opened a new pull request, #25420: 24464 finalize file write schema transform provider

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

   This PR closes #24980, and closes #24464 by:
   - Replacing CsvIOTestJavaBeans with SchemaAwareJavaBeans
   - Finalizing CSVFileWriteSchemaTransformProvider
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [x] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - ~Update `CHANGES.md` with noteworthy changes.~
    - ~If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).~
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/workflows/Go%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
   


-- 
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] damondouglas commented on a diff in pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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


##########
sdks/java/io/csv/build.gradle:
##########
@@ -31,4 +31,5 @@ dependencies {
     testImplementation project(path: ":sdks:java:core", configuration: "shadowTest")
     testImplementation library.java.junit
     testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow")
+    testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration")

Review Comment:
   @Abacn per our conversation resolving 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] Abacn merged pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #25420:
URL: https://github.com/apache/beam/pull/25420


-- 
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] damondouglas commented on pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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

   Run Whitespace PreCommit


-- 
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] Abacn commented on pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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

   thanks, will look into it when come back early next week


-- 
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 #25420: [24464] Finalize FileWriteSchemaTransformProvider

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25420:
URL: https://github.com/apache/beam/pull/25420#issuecomment-1425350911

   Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
   
   R: @robertwb for label java.
   R: @Abacn for label io.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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] Abacn commented on a diff in pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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


##########
sdks/java/io/csv/build.gradle:
##########
@@ -31,4 +31,5 @@ dependencies {
     testImplementation project(path: ":sdks:java:core", configuration: "shadowTest")
     testImplementation library.java.junit
     testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow")
+    testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration")

Review Comment:
   Notice this "testRuntimeMigration" is actually a workaround migrating to Gradle 7 (#16307) but somehow the TODO gets removed in #16430. 
   
   CC: @lukecwik Is this configuration still a pending cleanup and are new projects able to get rid of this flag? For this PR we can leave it as is for now.



-- 
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] damondouglas commented on a diff in pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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


##########
sdks/java/io/csv/src/main/java/org/apache/beam/sdk/io/csv/CsvIO.java:
##########
@@ -439,12 +475,16 @@ private static TextIO.Write writeWithCSVFormatHeaderAndComments(
         }
       }
 
-      CSVFormat withoutHeaderComments = csvFormat.withHeaderComments();
+      // We remove header comments since we've already processed them above.
+      // CSV commons library was designed with a single file write in mind
+      // which is why we need to manipulate CSVFormat in this way to be compatible
+      // in a TextIO.Write context.
+      CSVFormat withHeaderCommentsRemoved = csvFormat.withHeaderComments();
 
       result.add(
-          withoutHeaderComments
+          withHeaderCommentsRemoved
               // The withSkipHeaderRecord parameter prevents CSVFormat from outputting two copies of
-              // the header.
+              // the header; we already

Review Comment:
   TODO: @damondouglas Fix typo when checks finalize



-- 
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] damondouglas commented on pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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

   Seeing:
   ```
   11:56:16 Setting status of ca4de52a57e3e6993952c61864a5f3e34936b6a1 to SUCCESS with url https://ci-beam.apache.org/job/beam_PreCommit_Spotless_Commit/25237/ and message: 'Build finished. '
   11:56:16 Using context: Spotless ("Run Spotless PreCommit")
   11:56:16 Could not update commit status of the Pull Request on GitHub.
   12:14:23 org.kohsuke.github.GHIOException: Ran out of retries for URL: https://api.github.com/repos/apache/beam/statuses/ca4de52a57e3e6993952c61864a5f3e34936b6a1
   12:14:23 	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:407)
   12:14:23 	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
   12:14:23 	at org.kohsuke.github.Requester.fetch(Requester.java:76)
   12:14:23 	at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:2108)
   12:14:23 	at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.createCommitStatus(GhprbSimpleStatus.java:283)
   12:14:23 	at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.onBuildComplete(GhprbSimpleStatus.java:241)
   12:14:23 	at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:205)
   12:14:23 	at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:28)
   12:14:23 	at hudson.model.listeners.RunListener.lambda$fireCompleted$0(RunListener.java:207)
   12:14:23 	at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
   12:14:23 	at jenkins.util.Listeners.notify(Listeners.java:67)
   12:14:23 	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:205)
   12:14:23 	at hudson.model.Run.execute(Run.java:1941)
   12:14:23 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
   12:14:23 	at hudson.model.ResourceController.execute(ResourceController.java:101)
   12:14:23 	at hudson.model.Executor.run(Executor.java:442)
   12:14:23 [WS-CLEANUP] Deleting project workspace...
   12:14:23 [WS-CLEANUP] Deferred wipeout is used...
   12:14:23 [WS-CLEANUP] done
   12:14:23 Finished: SUCCESS
   ```


-- 
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] damondouglas commented on a diff in pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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


##########
sdks/java/io/csv/src/main/java/org/apache/beam/sdk/io/csv/CsvIO.java:
##########
@@ -439,12 +475,16 @@ private static TextIO.Write writeWithCSVFormatHeaderAndComments(
         }
       }
 
-      CSVFormat withoutHeaderComments = csvFormat.withHeaderComments();
+      // We remove header comments since we've already processed them above.
+      // CSV commons library was designed with a single file write in mind
+      // which is why we need to manipulate CSVFormat in this way to be compatible
+      // in a TextIO.Write context.
+      CSVFormat withHeaderCommentsRemoved = csvFormat.withHeaderComments();
 
       result.add(
-          withoutHeaderComments
+          withHeaderCommentsRemoved
               // The withSkipHeaderRecord parameter prevents CSVFormat from outputting two copies of
-              // the header.
+              // the header; we already

Review Comment:
   TODO: @damondouglas Fix type when checks finalize



-- 
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] damondouglas commented on a diff in pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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


##########
sdks/java/io/csv/build.gradle:
##########
@@ -31,4 +31,5 @@ dependencies {
     testImplementation project(path: ":sdks:java:core", configuration: "shadowTest")
     testImplementation library.java.junit
     testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow")
+    testImplementation project(path: ":sdks:java:io:common", configuration: "testRuntimeMigration")

Review Comment:
   @Abacn Thank you so much for reviewing.  FYI `testImplementation project(path: ":sdks:java:io:common")` causes: `error: package org.apache.beam.sdk.io.common does not exist`



-- 
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] Abacn commented on pull request #25420: [24464] Finalize FileWriteSchemaTransformProvider

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

   The pending Spotless job actually succeeded though status not updated on GitHub UI. Merging for now


-- 
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