Skip to content

Commit a4bc14c

Browse files
Update thrift library patch and prepare release (#140)
* Thrift patch: don't attempt to parse response on HTTP error status Signed-off-by: Levko Kravets <[email protected]> * Change a way we ship patched packages to increase compatibility Signed-off-by: Levko Kravets <[email protected]> * Prepare to release 1.2.1 Signed-off-by: Levko Kravets <[email protected]> * Fix publish scripts sequence Signed-off-by: Levko Kravets <[email protected]> --------- Signed-off-by: Levko Kravets <[email protected]>
1 parent feba37e commit a4bc14c

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## 1.x (Unreleased)
44

5+
## 1.2.1
6+
7+
- Added Azure AD support (databricks/databricks-sql-nodejs#126)
8+
- Improved direct results handling (databricks/databricks-sql-nodejs#134)
9+
- Updated API endpoint references in docs and samples (databricks/databricks-sql-nodejs#137)
10+
- Code refactoring to improve maintainability
11+
512
## 1.2.0
613

714
- Added Apache Arrow support (databricks/databricks-sql-nodejs#94)

package-lock.json

+5-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@databricks/sql",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Driver for connection to Databricks SQL via Thrift API.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -14,6 +14,7 @@
1414
"scripts": {
1515
"postinstall": "patch-package",
1616
"prepare": "npm run build",
17+
"prepack": "mkdir dist/node_modules && cp -R node_modules/thrift dist/node_modules/thrift",
1718
"e2e": "nyc --reporter=lcov --report-dir=coverage_e2e mocha --config tests/e2e/.mocharc.js",
1819
"test": "nyc --reporter=lcov --report-dir=coverage_unit mocha --config tests/unit/.mocharc.js",
1920
"update-version": "node bin/update-version.js && prettier --write ./lib/version.ts",
@@ -77,8 +78,5 @@
7778
"thrift": "^0.16.0",
7879
"uuid": "^9.0.0",
7980
"winston": "^3.8.2"
80-
},
81-
"bundledDependencies": [
82-
"thrift"
83-
]
81+
}
8482
}

patches/thrift+0.16.0.patch

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js b/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
2-
index 17e0d0c..d1ead4a 100644
2+
index 17e0d0c..9e90096 100644
33
--- a/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
44
+++ b/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
55
@@ -106,7 +106,7 @@ var HttpConnection = exports.HttpConnection = function(options) {
@@ -34,7 +34,7 @@ index 17e0d0c..d1ead4a 100644
3434
}
3535
}
3636
}
37-
@@ -165,17 +166,15 @@ var HttpConnection = exports.HttpConnection = function(options) {
37+
@@ -165,17 +166,17 @@ var HttpConnection = exports.HttpConnection = function(options) {
3838

3939
//Response handler
4040
//////////////////////////////////////////////////
@@ -46,6 +46,8 @@ index 17e0d0c..d1ead4a 100644
4646
if (response.statusCode !== 200) {
4747
- this.emit("error", new THTTPException(response));
4848
+ handleError(new THTTPException(response));
49+
+ response.destroy();
50+
+ return;
4951
}
5052

5153
- response.on('error', function (e) {
@@ -55,7 +57,7 @@ index 17e0d0c..d1ead4a 100644
5557

5658
// When running directly under node, chunk will be a buffer,
5759
// however, when running in a Browser (e.g. Browserify), chunk
58-
@@ -199,7 +198,9 @@ var HttpConnection = exports.HttpConnection = function(options) {
60+
@@ -199,7 +200,9 @@ var HttpConnection = exports.HttpConnection = function(options) {
5961
}
6062
//Get the receiver function for the transport and
6163
// call it with the buffer
@@ -66,7 +68,7 @@ index 17e0d0c..d1ead4a 100644
6668
});
6769
};
6870
};
69-
@@ -212,18 +213,33 @@ util.inherits(HttpConnection, EventEmitter);
71+
@@ -212,18 +215,33 @@ util.inherits(HttpConnection, EventEmitter);
7072
* @event {error} the "error" event is raised upon request failure passing the
7173
* Node.js error object to the listener.
7274
*/

0 commit comments

Comments
 (0)