@@ -42,9 +42,9 @@ class Meta:
42
42
autocommit = True
43
43
# If True and no bulk_size, then will set bulk_size to 1.
44
44
time_precision = "h"|"m"|s"|"ms"|"u"|"ns"
45
- #default is ns (nanoseconds)
46
- #Setting time precision while writing point
47
- #you should also make sure time set is in the given precision
45
+ # Default is ns (nanoseconds)
46
+ # Setting time precision while writing point
47
+ # You should also make sure time is set in the given precision
48
48
49
49
"""
50
50
@@ -77,22 +77,17 @@ def __new__(cls, *args, **kwargs):
77
77
cls ._autocommit = getattr (_meta , 'autocommit' , False )
78
78
cls ._time_precision = getattr (_meta , 'time_precision' , None )
79
79
80
- allowed_time_precisions = ["h" , "m" , "s" , "ms" , "u" , "ns" , None ]
80
+ allowed_time_precisions = ['h' , 'm' , 's' , 'ms' , 'u' , 'ns' , None ]
81
81
if cls ._time_precision not in allowed_time_precisions :
82
82
raise AttributeError (
83
- 'In {0}, time_precison is set, but invalid. use any of {}.'
84
- .format (cls .__name__ , ',' .join (allowed_time_precisions )))
85
-
86
- if cls ._autocommit and not cls ._client :
87
- raise AttributeError (
88
- 'In {0}, autocommit is set to True, but no client is set.'
89
- .format (cls .__name__ ))
83
+ 'In {0}, time_precision is set, but invalid use any of {}.'
84
+ .format (cls .__name__ , ',' .join (allowed_time_precisions )))
90
85
91
86
cls ._client = getattr (_meta , 'client' , None )
92
87
if cls ._autocommit and not cls ._client :
93
88
raise AttributeError (
94
89
'In {0}, autocommit is set to True, but no client is set.'
95
- .format (cls .__name__ ))
90
+ .format (cls .__name__ ))
96
91
97
92
try :
98
93
cls ._bulk_size = getattr (_meta , 'bulk_size' )
@@ -135,7 +130,7 @@ def __init__(self, **kw):
135
130
if not (tags <= keys ):
136
131
raise NameError (
137
132
'Expected arguments to contain all tags {0}, instead got {1}.'
138
- .format (cls ._tags , kw .keys ()))
133
+ .format (cls ._tags , kw .keys ()))
139
134
if not (keys - tags <= fields ):
140
135
raise NameError ('Got arguments not in tags or fields: {0}'
141
136
.format (keys - tags - fields ))
0 commit comments