Skip to content

Commit

Permalink
Fixed r.statusCode to Handle NUll
Browse files Browse the repository at this point in the history
  • Loading branch information
badrinathpatchikolla committed Nov 29, 2022
1 parent 06045ce commit e3f612e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

To add HTTP connector dependency to your sbt build:
```
libraryDependencies += "com.github.music-of-the-ainur" %% "http-almaren" % "1.2.5-2.4"
libraryDependencies += "com.github.music-of-the-ainur" %% "http-almaren" % "1.2.6-2.4"
```

To run in spark-shell:
```
spark-shell --master "local[*]" --packages "com.github.music-of-the-ainur:almaren-framework_2.11:0.9.8-2.4,com.github.music-of-the-ainur:http-almaren_2.11:1.2.5-2.4"
spark-shell --master "local[*]" --packages "com.github.music-of-the-ainur:almaren-framework_2.11:0.9.8-2.4,com.github.music-of-the-ainur:http-almaren_2.11:1.2.6-2.4"
```

## Table of Contents
Expand Down Expand Up @@ -41,12 +41,12 @@ repository.

| version | Connector Artifact |
|----------------------------|-------------------------------------------------------------|
| Spark 3.3.x and scala 2.13 | `com.github.music-of-the-ainur:http-almaren_2.13:1.2.5-3.3` |
| Spark 3.3.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.5-3.3` |
| Spark 3.2.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.5-3.2` |
| Spark 3.1.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.5-3.1` |
| Spark 2.4.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.5-2.4` |
| Spark 2.4.x and scala 2.11 | `com.github.music-of-the-ainur:http-almaren_2.11:1.2.5-2.4` |
| Spark 3.3.x and scala 2.13 | `com.github.music-of-the-ainur:http-almaren_2.13:1.2.6-3.3` |
| Spark 3.3.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.6-3.3` |
| Spark 3.2.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.6-3.2` |
| Spark 3.1.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.6-3.1` |
| Spark 2.4.x and scala 2.12 | `com.github.music-of-the-ainur:http-almaren_2.12:1.2.6-2.4` |
| Spark 2.4.x and scala 2.11 | `com.github.music-of-the-ainur:http-almaren_2.11:1.2.6-2.4` |

## Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ private[almaren] case class HTTP(
Some(r.text()),
r.headers,
Some(r.statusCode),
Some(r.statusMessage),
r.statusMessage match {
case null => None
case _ => Some(r.statusMessage)
},
`__ELAPSED_TIME__` = elapsedTime,
`__URL__` = url)
case Failure(f) => {
Expand Down Expand Up @@ -124,7 +127,10 @@ private[almaren] case class HTTPBatch(
Some(r.text()),
r.headers,
Some(r.statusCode),
Some(r.statusMessage),
r.statusMessage match {
case null => None
case _ => Some(r.statusMessage)
},
`__ELAPSED_TIME__` = System.currentTimeMillis() - startTime,
`__URL__` = url,
`__DATA__` = data
Expand Down

0 comments on commit e3f612e

Please sign in to comment.