typed_data 0.1.4 → 0.1.5
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 +4 -4
- data/README.md +1 -1
- data/lib/typed_data/converter.rb +1 -5
- data/lib/typed_data/schema/int_type.rb +1 -0
- data/lib/typed_data/schema/long_type.rb +2 -0
- data/lib/typed_data/schema/string_type.rb +2 -0
- data/lib/typed_data/schema/type.rb +6 -0
- data/lib/typed_data/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8328e9cdeaee3bbab6b796988ff1436fc913aa8be6078b99848fe96a4d109156
|
4
|
+
data.tar.gz: f3b471b2a4cbc86c8a8a3b07d038c373ca7272f5417f7dd4301cd25a187d4383
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15cf75777af9064e4804709b3c4aef5b3f29d867d29eefa4c93e20a5216b75c1e988809ecf985bf285178e2f1e36ff513316aeb69f179c695f196a511ce439e6
|
7
|
+
data.tar.gz: a00c6feb6091ed05d0e28c1afb26d386cab86aa3c110792423bd17f03c8637fb8fab500ea0e220c2c6dc8942f3b6fdc8a86f3668eb23c817d53c847de9495afe
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# TypedData
|
2
2
|
|
3
|
-

|
4
4
|
|
5
5
|
TypedData is a library that converts hash objects managed by an Avro schema so that the objects can be loaded into BigQuery.
|
6
6
|
|
data/lib/typed_data/converter.rb
CHANGED
@@ -97,11 +97,7 @@ module TypedData
|
|
97
97
|
when Schema::NullType
|
98
98
|
converted_value = nil
|
99
99
|
else
|
100
|
-
|
101
|
-
converted_value = subtype.coerce(value)
|
102
|
-
else
|
103
|
-
converted_value = subtype.coerce(value).to_s
|
104
|
-
end
|
100
|
+
converted_value = subtype.coerce(value)
|
105
101
|
end
|
106
102
|
|
107
103
|
if type.nullable_single?
|
@@ -1,10 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require "typed_data/schema/errors"
|
2
3
|
|
3
4
|
module TypedData
|
4
5
|
class Schema
|
5
6
|
class Type
|
7
|
+
SUPPORTED_LOGICAL_TYPES = []
|
8
|
+
|
6
9
|
def initialize(name, logical_type = nil)
|
7
10
|
@name = name
|
11
|
+
if logical_type && !self.class::SUPPORTED_LOGICAL_TYPES.include?(logical_type)
|
12
|
+
raise UnsupportedType, %Q{#{name} doesn't support the logical type "#{logical_type}"}
|
13
|
+
end
|
8
14
|
@logical_type = logical_type
|
9
15
|
end
|
10
16
|
|
data/lib/typed_data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typed_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- abicky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.1.
|
99
|
+
rubygems_version: 3.1.4
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: A library that converts hash objects managed by an Avro schema
|