File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## v0.7.6-alpha
4+
5+ - Added an error to handle empty relation size of 0 bytes when reading arrow files
6+
37## v0.7.5-alpha
48
59- Updated some dependencies.
Original file line number Diff line number Diff line change 11{
22 "name" : " @relationalai/rai-sdk-javascript" ,
33 "description" : " RelationalAI SDK for JavaScript" ,
4- "version" : " 0.7.5 -alpha" ,
4+ "version" : " 0.7.6 -alpha" ,
55 "author" : {
66 "name" : " RelationalAI" ,
77 "url" : " https://relational.ai"
Original file line number Diff line number Diff line change 1616
1717import { tableFromIPC } from 'apache-arrow' ;
1818
19- import { MaxRelationSizeError } from '../../errors' ;
19+ import { EmptyRelationSizeError , MaxRelationSizeError } from '../../errors' ;
2020import { MetadataInfo } from '../../proto/generated/message' ;
2121import { RelationId } from '../../proto/generated/schema' ;
2222import {
@@ -92,6 +92,13 @@ export async function readArrowFiles(files: TransactionAsyncFile[]) {
9292 ) ;
9393 }
9494
95+ // The part that exceeds 2GB is returned as a blob of 0 bytes,
96+ // all the remaining parts are empty as well in Windows’s Chrome,
97+ // therefore, throwing the error here to avoid failures downstream
98+ if ( file . file . size === 0 ) {
99+ throw new EmptyRelationSizeError ( file . name ) ;
100+ }
101+
95102 const table = await tableFromIPC ( file . file . stream ( ) ) ;
96103
97104 results . push ( {
Original file line number Diff line number Diff line change @@ -82,6 +82,16 @@ export class MaxRelationSizeError extends Error {
8282 }
8383}
8484
85+ export class EmptyRelationSizeError extends Error {
86+ constructor ( public relationId : string ) {
87+ const message = `Empty relation size of 0 bytes. Relation: ${ relationId } ` ;
88+
89+ super ( message ) ;
90+
91+ this . name = 'EmptyRelationSizeError' ;
92+ }
93+ }
94+
8595export class AbortError extends Error {
8696 constructor ( message ?: string ) {
8797 super ( message ) ;
@@ -99,4 +109,5 @@ export type SdkError =
99109 | ApiError
100110 | TransactionError
101111 | MaxRelationSizeError
112+ | EmptyRelationSizeError
102113 | Error ;
You can’t perform that action at this time.
0 commit comments