vastdb 0.0.5.3__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. vastdb-0.1.0/PKG-INFO +31 -0
  2. vastdb-0.1.0/README.md +181 -0
  3. vastdb-0.1.0/setup.py +48 -0
  4. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/GetTableStatsResponse.py +45 -1
  5. vastdb-0.1.0/vast_flatbuf/tabular/VipRange.py +56 -0
  6. vastdb-0.1.0/vastdb/__init__.py +7 -0
  7. vastdb-0.1.0/vastdb/bucket.py +77 -0
  8. vastdb-0.1.0/vastdb/errors.py +158 -0
  9. vastdb-0.0.5.3/vastdb/api.py → vastdb-0.1.0/vastdb/internal_commands.py +280 -746
  10. vastdb-0.1.0/vastdb/schema.py +77 -0
  11. vastdb-0.1.0/vastdb/session.py +48 -0
  12. vastdb-0.1.0/vastdb/table.py +480 -0
  13. vastdb-0.1.0/vastdb/tests/conftest.py +46 -0
  14. vastdb-0.1.0/vastdb/tests/test_imports.py +125 -0
  15. vastdb-0.1.0/vastdb/tests/test_projections.py +41 -0
  16. vastdb-0.1.0/vastdb/tests/test_sanity.py +83 -0
  17. vastdb-0.1.0/vastdb/tests/test_schemas.py +45 -0
  18. vastdb-0.1.0/vastdb/tests/test_tables.py +608 -0
  19. vastdb-0.1.0/vastdb/transaction.py +55 -0
  20. vastdb-0.1.0/vastdb/util.py +77 -0
  21. vastdb-0.1.0/vastdb.egg-info/PKG-INFO +31 -0
  22. {vastdb-0.0.5.3 → vastdb-0.1.0}/vastdb.egg-info/SOURCES.txt +17 -3
  23. {vastdb-0.0.5.3 → vastdb-0.1.0}/vastdb.egg-info/requires.txt +3 -1
  24. vastdb-0.0.5.3/PKG-INFO +0 -42
  25. vastdb-0.0.5.3/README.md +0 -1222
  26. vastdb-0.0.5.3/setup.py +0 -64
  27. vastdb-0.0.5.3/vastdb/bench_scan.py +0 -45
  28. vastdb-0.0.5.3/vastdb.egg-info/PKG-INFO +0 -42
  29. {vastdb-0.0.5.3 → vastdb-0.1.0}/LICENSE +0 -0
  30. {vastdb-0.0.5.3 → vastdb-0.1.0}/setup.cfg +0 -0
  31. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/__init__.py +0 -0
  32. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/__init__.py +0 -0
  33. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/__init__.py +0 -0
  34. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/__init__.py +0 -0
  35. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/__init__.py +0 -0
  36. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Aggregate.py +0 -0
  37. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ArraySlice.py +0 -0
  38. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ArraySubscript.py +0 -0
  39. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py +0 -0
  40. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py +0 -0
  41. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Bound.py +0 -0
  42. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Call.py +0 -0
  43. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/CaseFragment.py +0 -0
  44. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Cast.py +0 -0
  45. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py +0 -0
  46. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ConditionalCase.py +0 -0
  47. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/CurrentRow.py +0 -0
  48. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/DateLiteral.py +0 -0
  49. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py +0 -0
  50. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Deref.py +0 -0
  51. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/DurationLiteral.py +0 -0
  52. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Expression.py +0 -0
  53. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py +0 -0
  54. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/FieldIndex.py +0 -0
  55. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/FieldRef.py +0 -0
  56. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Filter.py +0 -0
  57. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/FixedSizeBinaryLiteral.py +0 -0
  58. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Float16Literal.py +0 -0
  59. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Float32Literal.py +0 -0
  60. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Float64Literal.py +0 -0
  61. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Following.py +0 -0
  62. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Frame.py +0 -0
  63. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Grouping.py +0 -0
  64. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Int16Literal.py +0 -0
  65. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Int32Literal.py +0 -0
  66. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Int64Literal.py +0 -0
  67. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Int8Literal.py +0 -0
  68. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py +0 -0
  69. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py +0 -0
  70. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py +0 -0
  71. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py +0 -0
  72. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Join.py +0 -0
  73. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/JoinKind.py +0 -0
  74. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/KeyValue.py +0 -0
  75. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Limit.py +0 -0
  76. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/ListLiteral.py +0 -0
  77. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Literal.py +0 -0
  78. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/LiteralColumn.py +0 -0
  79. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/LiteralImpl.py +0 -0
  80. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/LiteralRelation.py +0 -0
  81. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/MapKey.py +0 -0
  82. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/MapLiteral.py +0 -0
  83. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/OrderBy.py +0 -0
  84. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Ordering.py +0 -0
  85. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Plan.py +0 -0
  86. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Preceding.py +0 -0
  87. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Project.py +0 -0
  88. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/RelId.py +0 -0
  89. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Relation.py +0 -0
  90. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/RelationImpl.py +0 -0
  91. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/SetOpKind.py +0 -0
  92. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/SetOperation.py +0 -0
  93. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/SimpleCase.py +0 -0
  94. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/SortKey.py +0 -0
  95. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Source.py +0 -0
  96. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/StringLiteral.py +0 -0
  97. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/StructField.py +0 -0
  98. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/StructLiteral.py +0 -0
  99. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/TimeLiteral.py +0 -0
  100. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py +0 -0
  101. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/UInt16Literal.py +0 -0
  102. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/UInt32Literal.py +0 -0
  103. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/UInt64Literal.py +0 -0
  104. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/UInt8Literal.py +0 -0
  105. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/Unbounded.py +0 -0
  106. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/WindowCall.py +0 -0
  107. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/computeir/flatbuf/__init__.py +0 -0
  108. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Binary.py +0 -0
  109. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Block.py +0 -0
  110. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/BodyCompression.py +0 -0
  111. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/BodyCompressionMethod.py +0 -0
  112. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Bool.py +0 -0
  113. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Buffer.py +0 -0
  114. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/CompressionType.py +0 -0
  115. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Date.py +0 -0
  116. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/DateUnit.py +0 -0
  117. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Decimal.py +0 -0
  118. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/DictionaryBatch.py +0 -0
  119. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/DictionaryEncoding.py +0 -0
  120. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/DictionaryKind.py +0 -0
  121. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Duration.py +0 -0
  122. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Endianness.py +0 -0
  123. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Feature.py +0 -0
  124. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Field.py +0 -0
  125. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/FieldNode.py +0 -0
  126. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/FixedSizeBinary.py +0 -0
  127. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/FixedSizeList.py +0 -0
  128. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/FloatingPoint.py +0 -0
  129. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Footer.py +0 -0
  130. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Int.py +0 -0
  131. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Interval.py +0 -0
  132. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/IntervalUnit.py +0 -0
  133. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/KeyValue.py +0 -0
  134. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/LargeBinary.py +0 -0
  135. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/LargeList.py +0 -0
  136. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/LargeUtf8.py +0 -0
  137. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/List.py +0 -0
  138. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Map.py +0 -0
  139. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Message.py +0 -0
  140. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/MessageHeader.py +0 -0
  141. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/MetadataVersion.py +0 -0
  142. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Null.py +0 -0
  143. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Precision.py +0 -0
  144. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/RecordBatch.py +0 -0
  145. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Schema.py +0 -0
  146. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseMatrixCompressedAxis.py +0 -0
  147. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseMatrixIndexCSX.py +0 -0
  148. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseTensor.py +0 -0
  149. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseTensorIndex.py +0 -0
  150. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseTensorIndexCOO.py +0 -0
  151. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/SparseTensorIndexCSF.py +0 -0
  152. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Struct_.py +0 -0
  153. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Tensor.py +0 -0
  154. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/TensorDim.py +0 -0
  155. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Time.py +0 -0
  156. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/TimeUnit.py +0 -0
  157. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Timestamp.py +0 -0
  158. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Type.py +0 -0
  159. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Union.py +0 -0
  160. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/UnionMode.py +0 -0
  161. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/Utf8.py +0 -0
  162. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/org/apache/arrow/flatbuf/__init__.py +0 -0
  163. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/AlterColumnRequest.py +0 -0
  164. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/AlterProjectionTableRequest.py +0 -0
  165. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/AlterSchemaRequest.py +0 -0
  166. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/AlterTableRequest.py +0 -0
  167. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/Column.py +0 -0
  168. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ColumnType.py +0 -0
  169. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/CreateProjectionRequest.py +0 -0
  170. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/CreateSchemaRequest.py +0 -0
  171. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/GetProjectionTableStatsResponse.py +0 -0
  172. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ImportDataRequest.py +0 -0
  173. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ListProjectionsResponse.py +0 -0
  174. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ListSchemasResponse.py +0 -0
  175. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ListTablesResponse.py +0 -0
  176. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/ObjectDetails.py +0 -0
  177. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/S3File.py +0 -0
  178. {vastdb-0.0.5.3 → vastdb-0.1.0}/vast_flatbuf/tabular/__init__.py +0 -0
  179. {vastdb-0.0.5.3/vastdb → vastdb-0.1.0/vastdb/tests}/__init__.py +0 -0
  180. {vastdb-0.0.5.3 → vastdb-0.1.0}/vastdb.egg-info/dependency_links.txt +0 -0
  181. {vastdb-0.0.5.3 → vastdb-0.1.0}/vastdb.egg-info/top_level.txt +0 -0
vastdb-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.1
2
+ Name: vastdb
3
+ Version: 0.1.0
4
+ Summary: VAST Data SDK
5
+ Home-page: https://github.com/vast-data/vastdb_sdk
6
+ Author: VAST DATA
7
+ Author-email: hello@vastdata.com
8
+ License: Copyright (C) VAST Data Ltd.
9
+ Platform: UNKNOWN
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: Database :: Front-Ends
19
+ Requires-Python: >=3.9.0
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+
23
+
24
+ `vastdb` is a Python-based SDK designed for interacting
25
+ with [VAST Database](https://vastdata.com/database)
26
+ and [VAST Catalog](https://vastdata.com/blog/vast-catalog-treat-your-file-system-like-a-database),
27
+ enabling schema and table management, efficient ingest, query and modification of columnar data.
28
+
29
+ For more details, see [our whitepaper](https://vastdata.com/whitepaper/#TheVASTDataBase).
30
+
31
+
vastdb-0.1.0/README.md ADDED
@@ -0,0 +1,181 @@
1
+ [![version](https://img.shields.io/pypi/v/vastdb.svg)](https://pypi.org/project/vastdb)
2
+
3
+ # VAST DB Python SDK
4
+
5
+ 🚧 Please note that this package in a pre-release stage. Until version 1.x is officially released, the API should be considered unstable.
6
+
7
+ ## Introduction
8
+
9
+ `vastdb` is a Python-based SDK designed for interacting with [VAST Database](https://vastdata.com/database) & [VAST Catalog](https://vastdata.com/blog/vast-catalog-treat-your-file-system-like-a-database), enabling schema and table management, efficient ingest, query and modification of columnar data. For more details, see [our whitepaper](https://vastdata.com/whitepaper/#TheVASTDataBase).
10
+
11
+ [![vastdb](docs/vastdb.png)](https://vastdata.com/database)
12
+
13
+ ## Getting started
14
+
15
+ ### Requirements
16
+
17
+ - Linux client with Python 3.9+ and a network access to the VAST cluster
18
+ - [Virtual IP pool configured with DNS service](https://support.vastdata.com/s/topic/0TOV40000000FThOAM/configuring-network-access-v50)
19
+ - [S3 access & secret keys on VAST cluster](https://support.vastdata.com/s/article/UUID-4d2e7e23-b2fb-7900-d98f-96c31a499626)
20
+ - [Tabular identity policy with the proper permissions](https://support.vastdata.com/s/article/UUID-14322b60-d6a2-89ac-3df0-3dfbb6974182)
21
+
22
+
23
+ ### Installation
24
+
25
+ ```bash
26
+ pip install vastdb
27
+ ```
28
+
29
+ Also, see [our release notes](CHANGELOG.md).
30
+
31
+ ### Quickstart
32
+
33
+ Creating schemas and tables + basic inserts and selects:
34
+
35
+ ```python
36
+ import pyarrow as pa
37
+ import vastdb
38
+
39
+ session = vastdb.connect(
40
+ endpoint='http://vip-pool.v123-xy.VastENG.lab',
41
+ access=AWS_ACCESS_KEY_ID,
42
+ secret=AWS_SECRET_ACCESS_KEY)
43
+
44
+ with session.transaction() as tx:
45
+ bucket = tx.bucket("bucket-name")
46
+
47
+ schema = bucket.create_schema("schema-name")
48
+ print(bucket.schemas())
49
+
50
+ columns = pa.schema([
51
+ ('c1', pa.int16()),
52
+ ('c2', pa.float32()),
53
+ ('c3', pa.utf8()),
54
+ ])
55
+ table = schema.create_table("table-name", columns)
56
+ print(schema.tables())
57
+ print(table.columns())
58
+
59
+ arrow_table = pa.table(schema=columns, data=[
60
+ [111, 222, 333],
61
+ [0.5, 1.5, 2.5],
62
+ ['a', 'bb', 'ccc'],
63
+ ])
64
+ table.insert(arrow_table)
65
+
66
+ result = pa.Table.from_batches(table.select()) # SELECT * FROM t
67
+ assert result == arrow_table
68
+
69
+ # the transaction is automatically committed when exiting the context
70
+ ```
71
+
72
+ ## Filters and projections
73
+
74
+ Our SDK supports predicate and projection pushdown:
75
+
76
+ ```python
77
+ # SELECT c1 FROM t WHERE (c2 > 2) AND (c3 IS NULL)
78
+ table.select(columns=['c1'],
79
+ predicate=(table['c2'] > 2) & table['c3'].isnull())
80
+
81
+ # SELECT c2, c3 FROM t WHERE (c2 BETWEEN 0 AND 1) OR (c2 > 10)
82
+ table.select(columns=['c2', 'c3'],
83
+ predicate=table['c2'].between(0, 1) | (table['c2'] > 10))
84
+
85
+ # SELECT * FROM t WHERE c3 LIKE '%substring%'
86
+ table.select(predicate=table['c3'].contains('substring'))
87
+ ```
88
+
89
+ ## Import a single Parquet file via S3 protocol
90
+
91
+ It is possible to efficiently create a table from a Parquet file (without copying it via the client):
92
+
93
+ ```python
94
+ with tempfile.NamedTemporaryFile() as f:
95
+ pa.parquet.write_table(arrow_table, f.name)
96
+ s3.put_object(Bucket='bucket-name', Key='staging/file.parquet', Body=f)
97
+
98
+ schema = tx.bucket('bucket-name').schema('schema-name')
99
+ table = util.create_table_from_files(
100
+ schema=schema, table_name='imported-table',
101
+ parquet_files=['/bucket-name/staging/file.parquet'])
102
+ ```
103
+
104
+ ## Import multiple Parquet files concurrently via S3 protocol
105
+
106
+ We can import multiple files concurrently into a table (by utilizing multiple CNodes' cores):
107
+
108
+ ```python
109
+ schema = tx.bucket('bucket-name').schema('schema-name')
110
+ table = util.create_table_from_files(
111
+ schema=schema, table_name='large-imported-table',
112
+ parquet_files=[f'/bucket-name/staging/file{i}.parquet' for i in range(10)])
113
+ ```
114
+
115
+ ## Post-processing
116
+
117
+ ### Export
118
+
119
+ `Table.select()` returns a stream of [PyArrow record batches](https://arrow.apache.org/docs/python/data.html#record-batches), which can be directly exported into a Parquet file:
120
+
121
+ ```python
122
+ batches = table.select()
123
+ with contextlib.closing(pa.parquet.ParquetWriter('/path/to/file.parquet', batches.schema)) as writer:
124
+ for batch in table_batches:
125
+ writer.write_batch(batch)
126
+ ```
127
+
128
+ ### DuckDB
129
+
130
+ We can use [DuckDB](https://duckdb.org/docs/guides/python/sql_on_arrow.html) to post-process the resulting stream of [PyArrow record batches](https://arrow.apache.org/docs/python/data.html#record-batches):
131
+
132
+ ```python
133
+ import duckdb
134
+ conn = duckdb.connect()
135
+
136
+ batches = table.select(columns=['c1'], predicate=(table['c2'] > 2))
137
+ print(conn.execute("SELECT sum(c1) FROM batches").arrow())
138
+ ```
139
+
140
+ ## Semi-sorted projections
141
+
142
+ We can create, list and delete [available semi-sorted projections](https://support.vastdata.com/s/article/UUID-e4ca42ab-d15b-6b72-bd6b-f3c77b455de4):
143
+
144
+ ```python
145
+ p = table.create_projection('proj', sorted=['c3'], unsorted=['c1'])
146
+ print(table.projections())
147
+ print(p.get_stats())
148
+ p.drop()
149
+ ```
150
+
151
+ ## Snapshots
152
+
153
+ It is possible to list [available snapshots](https://vastdata.com/blog/bringing-snapshots-to-vasts-element-store):
154
+
155
+ ```python
156
+ print(bucket.list_snapshots())
157
+ ```
158
+
159
+ ## VAST Catalog
160
+
161
+ [VAST Catalog](https://vastdata.com/blog/vast-catalog-treat-your-file-system-like-a-database) can be queried as a regular table:
162
+
163
+ ```python
164
+ table = pa.Table.from_batches(tx.catalog.select(['element_type']))
165
+ df = table.to_pandas()
166
+
167
+ total_elements = len(df)
168
+ print(f"Total elements in the catalog: {total_elements}")
169
+
170
+ file_count = (df['element_type'] == 'FILE').sum()
171
+ print(f"Number of files/objects: {file_count}")
172
+
173
+ distinct_elements = df['element_type'].unique()
174
+ print("Distinct element types on the system:")
175
+ print(distinct_elements)
176
+ ```
177
+
178
+ See the following blog posts for more examples:
179
+
180
+ - https://vastdata.com/blog/the-vast-catalog-in-action-part-1
181
+ - https://vastdata.com/blog/the-vast-catalog-in-action-part-2
vastdb-0.1.0/setup.py ADDED
@@ -0,0 +1,48 @@
1
+ import os
2
+ from setuptools import setup, find_packages
3
+
4
+ long_description = """
5
+ `vastdb` is a Python-based SDK designed for interacting
6
+ with [VAST Database](https://vastdata.com/database)
7
+ and [VAST Catalog](https://vastdata.com/blog/vast-catalog-treat-your-file-system-like-a-database),
8
+ enabling schema and table management, efficient ingest, query and modification of columnar data.
9
+
10
+ For more details, see [our whitepaper](https://vastdata.com/whitepaper/#TheVASTDataBase).
11
+ """
12
+
13
+ def _get_version_suffix():
14
+ import subprocess
15
+
16
+ commit = subprocess.check_output(["git", "rev-parse", "HEAD"])
17
+ print(f"Git commit: {commit}")
18
+ return f".dev1+vast.{commit.decode()[:16]}"
19
+
20
+ suffix = ''
21
+ if os.environ.get('VASTDB_APPEND_VERSION_SUFFIX'):
22
+ suffix = _get_version_suffix()
23
+
24
+ setup(
25
+ name='vastdb',
26
+ python_requires='>=3.9.0',
27
+ description='VAST Data SDK',
28
+ version='0.1.0' + suffix,
29
+ url='https://github.com/vast-data/vastdb_sdk',
30
+ author='VAST DATA',
31
+ author_email='hello@vastdata.com',
32
+ license='Copyright (C) VAST Data Ltd.',
33
+ packages=find_packages(),
34
+ install_requires=open('requirements.txt').read().strip().split('\n'),
35
+ long_description=long_description,
36
+ long_description_content_type='text/markdown',
37
+ classifiers=[
38
+ 'Development Status :: 4 - Beta',
39
+ 'License :: OSI Approved :: Apache Software License',
40
+ 'Programming Language :: Python :: 3',
41
+ 'Programming Language :: Python :: 3.9',
42
+ 'Programming Language :: Python :: 3.10',
43
+ 'Programming Language :: Python :: 3.11',
44
+ 'Programming Language :: Python :: 3.12',
45
+ 'Topic :: Database',
46
+ 'Topic :: Database :: Front-Ends',
47
+ ],
48
+ )
@@ -45,7 +45,39 @@ class GetTableStatsResponse(object):
45
45
  return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
46
46
  return False
47
47
 
48
- def Start(builder): builder.StartObject(3)
48
+ # GetTableStatsResponse
49
+ def AddressType(self):
50
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
51
+ if o != 0:
52
+ return self._tab.String(o + self._tab.Pos)
53
+ return None
54
+
55
+ # GetTableStatsResponse
56
+ def Vips(self, j):
57
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
58
+ if o != 0:
59
+ x = self._tab.Vector(o)
60
+ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
61
+ x = self._tab.Indirect(x)
62
+ from vast_flatbuf.tabular.VipRange import VipRange
63
+ obj = VipRange()
64
+ obj.Init(self._tab.Bytes, x)
65
+ return obj
66
+ return None
67
+
68
+ # GetTableStatsResponse
69
+ def VipsLength(self):
70
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
71
+ if o != 0:
72
+ return self._tab.VectorLen(o)
73
+ return 0
74
+
75
+ # GetTableStatsResponse
76
+ def VipsIsNone(self):
77
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
78
+ return o == 0
79
+
80
+ def Start(builder): builder.StartObject(5)
49
81
  def GetTableStatsResponseStart(builder):
50
82
  """This method is deprecated. Please switch to Start."""
51
83
  return Start(builder)
@@ -61,6 +93,18 @@ def AddIsExternalRowidAlloc(builder, isExternalRowidAlloc): builder.PrependBoolS
61
93
  def GetTableStatsResponseAddIsExternalRowidAlloc(builder, isExternalRowidAlloc):
62
94
  """This method is deprecated. Please switch to AddIsExternalRowidAlloc."""
63
95
  return AddIsExternalRowidAlloc(builder, isExternalRowidAlloc)
96
+ def AddAddressType(builder, addressType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(addressType), 0)
97
+ def GetTableStatsResponseAddAddressType(builder, addressType):
98
+ """This method is deprecated. Please switch to AddAddressType."""
99
+ return AddAddressType(builder, addressType)
100
+ def AddVips(builder, vips): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(vips), 0)
101
+ def GetTableStatsResponseAddVips(builder, vips):
102
+ """This method is deprecated. Please switch to AddVips."""
103
+ return AddVips(builder, vips)
104
+ def StartVipsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
105
+ def GetTableStatsResponseStartVipsVector(builder, numElems):
106
+ """This method is deprecated. Please switch to Start."""
107
+ return StartVipsVector(builder, numElems)
64
108
  def End(builder): return builder.EndObject()
65
109
  def GetTableStatsResponseEnd(builder):
66
110
  """This method is deprecated. Please switch to End."""
@@ -0,0 +1,56 @@
1
+ # automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+ # namespace: tabular
4
+
5
+ import flatbuffers
6
+ from flatbuffers.compat import import_numpy
7
+ np = import_numpy()
8
+
9
+ class VipRange(object):
10
+ __slots__ = ['_tab']
11
+
12
+ @classmethod
13
+ def GetRootAs(cls, buf, offset=0):
14
+ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
15
+ x = VipRange()
16
+ x.Init(buf, n + offset)
17
+ return x
18
+
19
+ @classmethod
20
+ def GetRootAsVipRange(cls, buf, offset=0):
21
+ """This method is deprecated. Please switch to GetRootAs."""
22
+ return cls.GetRootAs(buf, offset)
23
+ # VipRange
24
+ def Init(self, buf, pos):
25
+ self._tab = flatbuffers.table.Table(buf, pos)
26
+
27
+ # VipRange
28
+ def StartAddress(self):
29
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
30
+ if o != 0:
31
+ return self._tab.String(o + self._tab.Pos)
32
+ return None
33
+
34
+ # VipRange
35
+ def AddressCount(self):
36
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
37
+ if o != 0:
38
+ return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
39
+ return 0
40
+
41
+ def Start(builder): builder.StartObject(2)
42
+ def VipRangeStart(builder):
43
+ """This method is deprecated. Please switch to Start."""
44
+ return Start(builder)
45
+ def AddStartAddress(builder, startAddress): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(startAddress), 0)
46
+ def VipRangeAddStartAddress(builder, startAddress):
47
+ """This method is deprecated. Please switch to AddStartAddress."""
48
+ return AddStartAddress(builder, startAddress)
49
+ def AddAddressCount(builder, addressCount): builder.PrependUint16Slot(1, addressCount, 0)
50
+ def VipRangeAddAddressCount(builder, addressCount):
51
+ """This method is deprecated. Please switch to AddAddressCount."""
52
+ return AddAddressCount(builder, addressCount)
53
+ def End(builder): return builder.EndObject()
54
+ def VipRangeEnd(builder):
55
+ """This method is deprecated. Please switch to End."""
56
+ return End(builder)
@@ -0,0 +1,7 @@
1
+ """VAST Database Python SDK."""
2
+
3
+ from . import session
4
+
5
+ # A helper function, useful as a short-hand for Session c-tor: `session = vastdb.connect(...)`
6
+ connect = session.Session
7
+ connect.__name__ = 'connect'
@@ -0,0 +1,77 @@
1
+ """VAST Database bucket.
2
+
3
+ VAST S3 buckets can be used to create Database schemas and tables.
4
+ It is possible to list and access VAST snapshots generated over a bucket.
5
+ """
6
+
7
+ from . import errors, schema, transaction
8
+
9
+ from dataclasses import dataclass
10
+ import logging
11
+
12
+ log = logging.getLogger(__name__)
13
+
14
+
15
+ @dataclass
16
+ class Snapshot:
17
+ """VAST bucket-level snapshot."""
18
+
19
+ name: str
20
+ bucket: "Bucket"
21
+
22
+
23
+ @dataclass
24
+ class Bucket:
25
+ """VAST bucket."""
26
+
27
+ name: str
28
+ tx: "transaction.Transaction"
29
+
30
+ def create_schema(self, path: str) -> "schema.Schema":
31
+ """Create a new schema (a container of tables) under this bucket."""
32
+ self.tx._rpc.api.create_schema(self.name, path, txid=self.tx.txid)
33
+ log.info("Created schema: %s", path)
34
+ return self.schema(path)
35
+
36
+ def schema(self, path: str) -> "schema.Schema":
37
+ """Get a specific schema (a container of tables) under this bucket."""
38
+ s = self.schemas(path)
39
+ log.debug("schema: %s", s)
40
+ if not s:
41
+ raise errors.MissingSchema(self.name, path)
42
+ assert len(s) == 1, f"Expected to receive only a single schema, but got: {len(s)}. ({s})"
43
+ log.debug("Found schema: %s", s[0].name)
44
+ return s[0]
45
+
46
+ def schemas(self, name: str = None) -> ["schema.Schema"]:
47
+ """List bucket's schemas."""
48
+ schemas = []
49
+ next_key = 0
50
+ exact_match = bool(name)
51
+ log.debug("list schemas param: schema=%s, exact_match=%s", name, exact_match)
52
+ while True:
53
+ bucket_name, curr_schemas, next_key, is_truncated, _ = \
54
+ self.tx._rpc.api.list_schemas(bucket=self.name, next_key=next_key, txid=self.tx.txid,
55
+ name_prefix=name, exact_match=exact_match)
56
+ if not curr_schemas:
57
+ break
58
+ schemas.extend(curr_schemas)
59
+ if not is_truncated:
60
+ break
61
+
62
+ return [schema.Schema(name=name, bucket=self) for name, *_ in schemas]
63
+
64
+ def snapshots(self) -> [Snapshot]:
65
+ """List bucket's snapshots."""
66
+ snapshots = []
67
+ next_key = 0
68
+ while True:
69
+ curr_snapshots, is_truncated, next_key = \
70
+ self.tx._rpc.api.list_snapshots(bucket=self.name, next_token=next_key)
71
+ if not curr_snapshots:
72
+ break
73
+ snapshots.extend(curr_snapshots)
74
+ if not is_truncated:
75
+ break
76
+
77
+ return [Snapshot(name=snapshot, bucket=self) for snapshot in snapshots]
@@ -0,0 +1,158 @@
1
+ import logging
2
+ import requests
3
+ import xml.etree.ElementTree
4
+
5
+ from enum import Enum
6
+ from dataclasses import dataclass
7
+
8
+
9
+ class HttpStatus(Enum):
10
+ SUCCESS = 200
11
+ BAD_REQUEST = 400
12
+ FOBIDDEN = 403
13
+ NOT_FOUND = 404
14
+ METHOD_NOT_ALLOWED = 405
15
+ REQUEST_TIMEOUT = 408
16
+ CONFLICT = 409
17
+ INTERNAL_SERVER_ERROR = 500
18
+ NOT_IMPLEMENTED = 501
19
+ SERVICE_UNAVAILABLE = 503
20
+
21
+
22
+ log = logging.getLogger(__name__)
23
+
24
+
25
+ @dataclass
26
+ class HttpError(Exception):
27
+ code: str
28
+ message: str
29
+ url: str
30
+ status: int # HTTP status
31
+ headers: requests.structures.CaseInsensitiveDict # HTTP response headers
32
+
33
+ def __post_init__(self):
34
+ self.args = [vars(self)]
35
+
36
+
37
+ class NotFound(HttpError):
38
+ pass
39
+
40
+
41
+ class Forbidden(HttpError):
42
+ pass
43
+
44
+
45
+ class BadRequest(HttpError):
46
+ pass
47
+
48
+
49
+ class MethodNotAllowed(HttpError):
50
+ pass
51
+
52
+
53
+ class RequestTimeout(HttpError):
54
+ pass
55
+
56
+
57
+ class Conflict(HttpError):
58
+ pass
59
+
60
+
61
+ class InternalServerError(HttpError):
62
+ pass
63
+
64
+
65
+ class NotImplemented(HttpError):
66
+ pass
67
+
68
+
69
+ class ServiceUnavailable(HttpError):
70
+ pass
71
+
72
+
73
+ class UnexpectedError(HttpError):
74
+ pass
75
+
76
+
77
+ @dataclass
78
+ class ImportFilesError(Exception):
79
+ message: str
80
+ error_dict: dict
81
+
82
+
83
+ class InvalidArgument(Exception):
84
+ pass
85
+
86
+
87
+ class Missing(Exception):
88
+ pass
89
+
90
+
91
+ @dataclass
92
+ class MissingBucket(Missing):
93
+ bucket: str
94
+
95
+
96
+ @dataclass
97
+ class MissingSchema(Missing):
98
+ bucket: str
99
+ schema: str
100
+
101
+
102
+ @dataclass
103
+ class MissingTable(Missing):
104
+ bucket: str
105
+ schema: str
106
+ table: str
107
+
108
+
109
+ @dataclass
110
+ class MissingProjection(Missing):
111
+ bucket: str
112
+ schema: str
113
+ table: str
114
+ projection: str
115
+
116
+
117
+ ERROR_TYPES_MAP = {
118
+ HttpStatus.BAD_REQUEST: BadRequest,
119
+ HttpStatus.FOBIDDEN: Forbidden,
120
+ HttpStatus.NOT_FOUND: NotFound,
121
+ HttpStatus.METHOD_NOT_ALLOWED: MethodNotAllowed,
122
+ HttpStatus.REQUEST_TIMEOUT: RequestTimeout,
123
+ HttpStatus.CONFLICT: Conflict,
124
+ HttpStatus.INTERNAL_SERVER_ERROR: InternalServerError,
125
+ HttpStatus.NOT_IMPLEMENTED: NotImplemented,
126
+ HttpStatus.SERVICE_UNAVAILABLE: ServiceUnavailable,
127
+ }
128
+
129
+
130
+ def from_response(res: requests.Response):
131
+ if res.status_code == HttpStatus.SUCCESS.value:
132
+ return None
133
+
134
+ log.debug("response: url='%s', code=%s, headers=%s, body='%s'", res.request.url, res.status_code, res.headers, res.text)
135
+ # try to parse S3 XML response for the error details:
136
+ code = None
137
+ message = None
138
+ if res.text:
139
+ try:
140
+ root = xml.etree.ElementTree.fromstring(res.text)
141
+ code = root.find('Code')
142
+ code = code.text if code is not None else None
143
+ message = root.find('Message')
144
+ message = message.text if message is not None else None
145
+ except xml.etree.ElementTree.ParseError:
146
+ log.debug("invalid XML: %r", res.text)
147
+
148
+ kwargs = dict(
149
+ code=code,
150
+ message=message,
151
+ url=res.request.url,
152
+ status=res.status_code,
153
+ headers=res.headers,
154
+ )
155
+ log.warning("RPC failed: %s", kwargs)
156
+ status = HttpStatus(res.status_code)
157
+ error_type = ERROR_TYPES_MAP.get(status, UnexpectedError)
158
+ raise error_type(**kwargs)