mpql 0.2.0 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a4b924a0c0fafb25811a59d44b8dfd9b281b450a06d9547eb69859cf22eb2d
4
- data.tar.gz: a2a9178c2b289bcbff5b6fcf39b4e2eeca39b6e9aa0cb6d8f8616db602e5d1b3
3
+ metadata.gz: 63f6d1580b0cfe2dd287109819933593584580d1ce946189259bbc2e02d388e3
4
+ data.tar.gz: e787d7df3af32c6456437b2253e17959b4f796137be7bd62e18eca36661a02ef
5
5
  SHA512:
6
- metadata.gz: ef4ad93c709263dec06dae1a17cf9691d19a37fbc5807a516504100bc4c863c3c208ec945d0741d384a3e48d396e24cc3dd8b15a3421b9522033dd765c40bd87
7
- data.tar.gz: f080578244e1a661aeb241c55793467fe673167f6265f5522b433bde8cffc1c7f82bd6014def1d48c02db30c9589160094e5add0c1d3db564619b08e05c63da4
6
+ metadata.gz: 3a4e8f13e344c494f35a88310fee8458c92d45c350c3776dcffbe8130656dd425db3239f2ad15c947a064ab2eac438b721b9438a1e1bccd815964d2533412bc7
7
+ data.tar.gz: c053010c82aecc7459e0a99f77eb501bc1a33d45b3b95b97d319771b1624a963abe04619fb7585a4222a11f46a5f75a6a33b367392e89cf0cef2b58d2f52762d
data/lib/mpql/cli.rb CHANGED
@@ -19,7 +19,7 @@ module Mpql
19
19
  desc: "Output raw JSON without pretty-printing"
20
20
  class_option :region, type: :string, enum: %w[us eu in],
21
21
  desc: "MixPanel region (us, eu, in)"
22
- class_option :project_id, type: :string, required: true,
22
+ class_option :project_id, type: :string,
23
23
  desc: "MixPanel project ID"
24
24
 
25
25
  desc "segmentation", "Query segmentation data for an event"
@@ -173,7 +173,8 @@ module Mpql
173
173
  if distinct_ids && distinct_ids.length == 1
174
174
  params[:distinct_id] = distinct_ids.first
175
175
  elsif distinct_ids && distinct_ids.length > 1
176
- where_clause = %(properties["$distinct_id"] in #{JSON.generate(distinct_ids)})
176
+ conditions = distinct_ids.map { |id| %(properties["$distinct_id"] == "#{id}") }
177
+ where_clause = conditions.join(" or ")
177
178
  params[:where] = params[:where] ? "(#{params[:where]}) and (#{where_clause})" : where_clause
178
179
  end
179
180
  result = client.engage(**params)
data/lib/mpql/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mpql
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tomorrowkey