dont print apikey in remote client toString, add hostoverride to python client (#353)

This commit is contained in:
Rob Meng
2023-07-23 18:44:00 -04:00
committed by GitHub
parent ed5ff5a482
commit 8325979bb8
4 changed files with 30 additions and 9 deletions

View File

@@ -18,13 +18,15 @@ import { tableFromIPC, type Table as ArrowTable } from 'apache-arrow'
export class HttpLancedbClient {
private readonly _url: string
private readonly _apiKey: () => string
public constructor (
url: string,
private readonly _apiKey: string,
apiKey: string,
private readonly _dbName?: string
) {
this._url = url
this._apiKey = () => apiKey
}
get uri (): string {
@@ -53,7 +55,7 @@ export class HttpLancedbClient {
{
headers: {
'Content-Type': 'application/json',
'x-api-key': this._apiKey,
'x-api-key': this._apiKey(),
...(this._dbName !== undefined ? { 'x-lancedb-database': this._dbName } : {})
},
responseType: 'arraybuffer',
@@ -84,7 +86,7 @@ export class HttpLancedbClient {
{
headers: {
'Content-Type': 'application/json',
'x-api-key': this._apiKey
'x-api-key': this._apiKey()
},
params,
timeout: 10000