-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing withErrorHanding from inferrers
- Loading branch information
Showing
5 changed files
with
127 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
snapi-frontend/src/test/scala/raw/inferrer/local/RD3852.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package raw.inferrer.local | ||
|
||
import com.typesafe.scalalogging.StrictLogging | ||
import raw.client.api.LocationDescription | ||
import raw.inferrer.api.{ | ||
AutoInferrerProperties, | ||
CsvInputFormatDescriptor, | ||
LinesInputFormatDescriptor, | ||
TextInputStreamFormatDescriptor | ||
} | ||
import raw.sources.api.SourceContext | ||
import raw.sources.filesystem.local.LocalLocationsTestContext | ||
import raw.utils.{RawTestSuite, RawUtils, SettingsTestContext} | ||
import raw.sources.filesystem.local.LocalPath | ||
|
||
class RD3852 extends RawTestSuite with SettingsTestContext with StrictLogging with LocalLocationsTestContext { | ||
|
||
|
||
// CSV is the last in the list in the auto inferrer. | ||
// So inferring this a csv file means that the other inferrers threw correctly | ||
// a LocalInferrerException while trying to parse the file | ||
test("Auto inferring CSV") { _ => | ||
implicit val sourceContext = new SourceContext(null, null, settings, None) | ||
val inferrer = new LocalInferrerService | ||
val p = RawUtils.getResource("data/students/students.csv") | ||
val l1 = new LocalPath(p) | ||
try { | ||
|
||
val TextInputStreamFormatDescriptor(_, _, format) = | ||
inferrer.infer(AutoInferrerProperties(LocationDescription(l1.rawUri), None)) | ||
assert(format.isInstanceOf[CsvInputFormatDescriptor]) | ||
|
||
} finally { | ||
RawUtils.withSuppressNonFatalException(inferrer.stop()) | ||
} | ||
} | ||
|
||
} |