Class: Polars::ScanCastOptions
- Inherits:
-
Object
- Object
- Polars::ScanCastOptions
- Defined in:
- lib/polars/scan_cast_options.rb
Overview
Options for scanning files.
Instance Attribute Summary collapse
-
#datetime_cast ⇒ Object
readonly
Returns the value of attribute datetime_cast.
-
#extra_struct_fields ⇒ Object
readonly
Returns the value of attribute extra_struct_fields.
-
#float_cast ⇒ Object
readonly
Returns the value of attribute float_cast.
-
#integer_cast ⇒ Object
readonly
Returns the value of attribute integer_cast.
-
#missing_struct_fields ⇒ Object
readonly
Returns the value of attribute missing_struct_fields.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(integer_cast: "forbid", float_cast: "forbid", datetime_cast: "forbid", missing_struct_fields: "raise", extra_struct_fields: "raise", _internal_call: false) ⇒ ScanCastOptions
constructor
Common configuration for scanning files.
Constructor Details
#initialize(integer_cast: "forbid", float_cast: "forbid", datetime_cast: "forbid", missing_struct_fields: "raise", extra_struct_fields: "raise", _internal_call: false) ⇒ ScanCastOptions
Note:
This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.
Common configuration for scanning files.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/polars/scan_cast_options.rb', line 47 def initialize( integer_cast: "forbid", float_cast: "forbid", datetime_cast: "forbid", missing_struct_fields: "raise", extra_struct_fields: "raise", _internal_call: false ) if !_internal_call warn "ScanCastOptions is considered unstable." end @integer_cast = integer_cast @float_cast = float_cast @datetime_cast = datetime_cast @missing_struct_fields = missing_struct_fields @extra_struct_fields = extra_struct_fields end |
Instance Attribute Details
#datetime_cast ⇒ Object (readonly)
Returns the value of attribute datetime_cast.
4 5 6 |
# File 'lib/polars/scan_cast_options.rb', line 4 def datetime_cast @datetime_cast end |
#extra_struct_fields ⇒ Object (readonly)
Returns the value of attribute extra_struct_fields.
4 5 6 |
# File 'lib/polars/scan_cast_options.rb', line 4 def extra_struct_fields @extra_struct_fields end |
#float_cast ⇒ Object (readonly)
Returns the value of attribute float_cast.
4 5 6 |
# File 'lib/polars/scan_cast_options.rb', line 4 def float_cast @float_cast end |
#integer_cast ⇒ Object (readonly)
Returns the value of attribute integer_cast.
4 5 6 |
# File 'lib/polars/scan_cast_options.rb', line 4 def integer_cast @integer_cast end |
#missing_struct_fields ⇒ Object (readonly)
Returns the value of attribute missing_struct_fields.
4 5 6 |
# File 'lib/polars/scan_cast_options.rb', line 4 def missing_struct_fields @missing_struct_fields end |
Class Method Details
._default ⇒ Object
66 67 68 |
# File 'lib/polars/scan_cast_options.rb', line 66 def self._default new(_internal_call: true) end |
._default_iceberg ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/polars/scan_cast_options.rb', line 70 def self._default_iceberg @_default_cast_options_iceberg ||= begin ScanCastOptions.new( integer_cast: "upcast", float_cast: ["upcast", "downcast"], datetime_cast: ["nanosecond-downcast", "convert-timezone"], missing_struct_fields: "insert", extra_struct_fields: "ignore", _internal_call: true ) end end |