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

Correct shardNameTemplate in tests #4817

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ParquetAvroIOFileNamePolicyTest extends FileNamePolicySpec[TestRecord] {
override def failSaves = Seq(
_.map(AvroUtils.newSpecificRecord).saveAsParquetAvroFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ParquetExampleIOFileNamePolicyTest extends FileNamePolicySpec[Example] {
_.map(newExample).saveAsParquetExampleFile(
"nonsense",
schema,
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ParquetTypeIOFileNamePolicyTest extends FileNamePolicySpec[Wide] {
override def failSaves: Seq[SCollection[Int] => ClosedTap[Wide]] = Seq(
_.map(i => Wide(i, i.toString, Some(i), (1 to i).toList)).saveAsTypedParquetFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TFExampleIOFileNamePolicyTest extends FileNamePolicySpec[Example] {
override def failSaves = Seq(
_.map(x => recordT(Record(x, x.toString))).saveAsTfRecordFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand Down
10 changes: 5 additions & 5 deletions scio-test/src/test/scala/com/spotify/scio/io/ScioIOTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class AvroIOFileNamePolicyTest extends FileNamePolicySpec[TestRecord] {
override def failSaves: Seq[SCollection[Int] => ClosedTap[TestRecord]] = Seq(
_.map(AvroUtils.newSpecificRecord).saveAsAvroFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand All @@ -192,7 +192,7 @@ class TextIOFileNamePolicyTest extends FileNamePolicySpec[String] {
override def failSaves: Seq[SCollection[Int] => ClosedTap[String]] = Seq(
_.map(_.toString).saveAsTextFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand All @@ -217,7 +217,7 @@ class ObjectIOFileNamePolicyTest extends FileNamePolicySpec[ScioIOTest.AvroRecor
override def failSaves: Seq[SCollection[Int] => ClosedTap[AvroRecord]] = Seq(
_.map(x => AvroRecord(x, x.toString, (1 to x).map(_.toString).toList)).saveAsObjectFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand All @@ -240,7 +240,7 @@ class ProtobufIOFileNamePolicyTest extends FileNamePolicySpec[TrackPB] {
override def failSaves: Seq[SCollection[Int] => ClosedTap[TrackPB]] = Seq(
_.map(x => TrackPB.newBuilder().setTrackId(x.toString).build()).saveAsProtobufFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
)
)
Expand All @@ -263,7 +263,7 @@ class BinaryIOFileNamePolicyTest extends FileNamePolicySpec[Nothing] {
override def failSaves: Seq[SCollection[Int] => ClosedTap[Nothing]] = Seq(
_.map(x => ByteBuffer.allocate(4).putInt(x).array).saveAsBinaryFile(
"nonsense",
shardNameTemplate = "NNN-of-NNN",
shardNameTemplate = "SSS-of-NNN",
filenamePolicySupplier = testFilenamePolicySupplier
),
_.map(x => ByteBuffer.allocate(4).putInt(x).array).saveAsBinaryFile(
Expand Down