polars-df 0.3.1 → 0.4.0

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.
data/lib/polars/utils.rb CHANGED
@@ -93,8 +93,12 @@ module Polars
93
93
  Polars.lit(value)
94
94
  end
95
95
 
96
- def self.format_path(path)
97
- File.expand_path(path)
96
+ def self.normalise_filepath(path, check_not_directory: true)
97
+ path = File.expand_path(path)
98
+ if check_not_directory && File.exist?(path) && Dir.exist?(path)
99
+ raise ArgumentError, "Expected a file path; #{path} is a directory"
100
+ end
101
+ path
98
102
  end
99
103
 
100
104
  # TODO fix
@@ -216,5 +220,9 @@ module Polars
216
220
  val.is_a?(Array) && _is_iterable_of(val, String)
217
221
  end
218
222
  end
223
+
224
+ def self.local_file?(file)
225
+ Dir.glob(file).any?
226
+ end
219
227
  end
220
228
  end
@@ -1,4 +1,4 @@
1
1
  module Polars
2
2
  # @private
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
data/lib/polars.rb CHANGED
@@ -12,6 +12,8 @@ require "stringio"
12
12
  # modules
13
13
  require_relative "polars/expr_dispatch"
14
14
  require_relative "polars/batched_csv_reader"
15
+ require_relative "polars/binary_expr"
16
+ require_relative "polars/binary_name_space"
15
17
  require_relative "polars/cat_expr"
16
18
  require_relative "polars/cat_name_space"
17
19
  require_relative "polars/convert"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polars-df
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-22 00:00:00.000000000 Z
11
+ date: 2023-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -65,6 +65,8 @@ files:
65
65
  - lib/polars-df.rb
66
66
  - lib/polars.rb
67
67
  - lib/polars/batched_csv_reader.rb
68
+ - lib/polars/binary_expr.rb
69
+ - lib/polars/binary_name_space.rb
68
70
  - lib/polars/cat_expr.rb
69
71
  - lib/polars/cat_name_space.rb
70
72
  - lib/polars/convert.rb
@@ -116,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  - !ruby/object:Gem::Version
117
119
  version: '0'
118
120
  requirements: []
119
- rubygems_version: 3.4.6
121
+ rubygems_version: 3.4.10
120
122
  signing_key:
121
123
  specification_version: 4
122
124
  summary: Blazingly fast DataFrames for Ruby