@@ -248,10 +248,12 @@ def csv(
248248 def parquet (self , * paths : str , ** options : "OptionalPrimitiveType" ) -> "DataFrame" :
249249 input = list (paths )
250250 if len (input ) != 1 :
251- raise NotImplementedError ("Only single paths are supported for now" )
251+ msg = "Only single paths are supported for now"
252+ raise NotImplementedError (msg )
252253 option_amount = len (options .keys ())
253254 if option_amount != 0 :
254- raise ContributionsAcceptedError ("Options are not supported" )
255+ msg = "Options are not supported"
256+ raise ContributionsAcceptedError (msg )
255257 path = input [0 ]
256258 rel = self .session .conn .read_parquet (path )
257259 from ..sql .dataframe import DataFrame
@@ -338,53 +340,77 @@ def json(
338340 +---+------------+
339341 """
340342 if schema is not None :
341- raise ContributionsAcceptedError ("The 'schema' option is not supported" )
343+ msg = "The 'schema' option is not supported"
344+ raise ContributionsAcceptedError (msg )
342345 if primitivesAsString is not None :
343- raise ContributionsAcceptedError ("The 'primitivesAsString' option is not supported" )
346+ msg = "The 'primitivesAsString' option is not supported"
347+ raise ContributionsAcceptedError (msg )
344348 if prefersDecimal is not None :
345- raise ContributionsAcceptedError ("The 'prefersDecimal' option is not supported" )
349+ msg = "The 'prefersDecimal' option is not supported"
350+ raise ContributionsAcceptedError (msg )
346351 if allowComments is not None :
347- raise ContributionsAcceptedError ("The 'allowComments' option is not supported" )
352+ msg = "The 'allowComments' option is not supported"
353+ raise ContributionsAcceptedError (msg )
348354 if allowUnquotedFieldNames is not None :
349- raise ContributionsAcceptedError ("The 'allowUnquotedFieldNames' option is not supported" )
355+ msg = "The 'allowUnquotedFieldNames' option is not supported"
356+ raise ContributionsAcceptedError (msg )
350357 if allowSingleQuotes is not None :
351- raise ContributionsAcceptedError ("The 'allowSingleQuotes' option is not supported" )
358+ msg = "The 'allowSingleQuotes' option is not supported"
359+ raise ContributionsAcceptedError (msg )
352360 if allowNumericLeadingZero is not None :
353- raise ContributionsAcceptedError ("The 'allowNumericLeadingZero' option is not supported" )
361+ msg = "The 'allowNumericLeadingZero' option is not supported"
362+ raise ContributionsAcceptedError (msg )
354363 if allowBackslashEscapingAnyCharacter is not None :
355- raise ContributionsAcceptedError ("The 'allowBackslashEscapingAnyCharacter' option is not supported" )
364+ msg = "The 'allowBackslashEscapingAnyCharacter' option is not supported"
365+ raise ContributionsAcceptedError (msg )
356366 if mode is not None :
357- raise ContributionsAcceptedError ("The 'mode' option is not supported" )
367+ msg = "The 'mode' option is not supported"
368+ raise ContributionsAcceptedError (msg )
358369 if columnNameOfCorruptRecord is not None :
359- raise ContributionsAcceptedError ("The 'columnNameOfCorruptRecord' option is not supported" )
370+ msg = "The 'columnNameOfCorruptRecord' option is not supported"
371+ raise ContributionsAcceptedError (msg )
360372 if dateFormat is not None :
361- raise ContributionsAcceptedError ("The 'dateFormat' option is not supported" )
373+ msg = "The 'dateFormat' option is not supported"
374+ raise ContributionsAcceptedError (msg )
362375 if timestampFormat is not None :
363- raise ContributionsAcceptedError ("The 'timestampFormat' option is not supported" )
376+ msg = "The 'timestampFormat' option is not supported"
377+ raise ContributionsAcceptedError (msg )
364378 if multiLine is not None :
365- raise ContributionsAcceptedError ("The 'multiLine' option is not supported" )
379+ msg = "The 'multiLine' option is not supported"
380+ raise ContributionsAcceptedError (msg )
366381 if allowUnquotedControlChars is not None :
367- raise ContributionsAcceptedError ("The 'allowUnquotedControlChars' option is not supported" )
382+ msg = "The 'allowUnquotedControlChars' option is not supported"
383+ raise ContributionsAcceptedError (msg )
368384 if lineSep is not None :
369- raise ContributionsAcceptedError ("The 'lineSep' option is not supported" )
385+ msg = "The 'lineSep' option is not supported"
386+ raise ContributionsAcceptedError (msg )
370387 if samplingRatio is not None :
371- raise ContributionsAcceptedError ("The 'samplingRatio' option is not supported" )
388+ msg = "The 'samplingRatio' option is not supported"
389+ raise ContributionsAcceptedError (msg )
372390 if dropFieldIfAllNull is not None :
373- raise ContributionsAcceptedError ("The 'dropFieldIfAllNull' option is not supported" )
391+ msg = "The 'dropFieldIfAllNull' option is not supported"
392+ raise ContributionsAcceptedError (msg )
374393 if encoding is not None :
375- raise ContributionsAcceptedError ("The 'encoding' option is not supported" )
394+ msg = "The 'encoding' option is not supported"
395+ raise ContributionsAcceptedError (msg )
376396 if locale is not None :
377- raise ContributionsAcceptedError ("The 'locale' option is not supported" )
397+ msg = "The 'locale' option is not supported"
398+ raise ContributionsAcceptedError (msg )
378399 if pathGlobFilter is not None :
379- raise ContributionsAcceptedError ("The 'pathGlobFilter' option is not supported" )
400+ msg = "The 'pathGlobFilter' option is not supported"
401+ raise ContributionsAcceptedError (msg )
380402 if recursiveFileLookup is not None :
381- raise ContributionsAcceptedError ("The 'recursiveFileLookup' option is not supported" )
403+ msg = "The 'recursiveFileLookup' option is not supported"
404+ raise ContributionsAcceptedError (msg )
382405 if modifiedBefore is not None :
383- raise ContributionsAcceptedError ("The 'modifiedBefore' option is not supported" )
406+ msg = "The 'modifiedBefore' option is not supported"
407+ raise ContributionsAcceptedError (msg )
384408 if modifiedAfter is not None :
385- raise ContributionsAcceptedError ("The 'modifiedAfter' option is not supported" )
409+ msg = "The 'modifiedAfter' option is not supported"
410+ raise ContributionsAcceptedError (msg )
386411 if allowNonNumericNumbers is not None :
387- raise ContributionsAcceptedError ("The 'allowNonNumericNumbers' option is not supported" )
412+ msg = "The 'allowNonNumericNumbers' option is not supported"
413+ raise ContributionsAcceptedError (msg )
388414
389415 if isinstance (path , str ):
390416 path = [path ]
0 commit comments