Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hshetl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
hshetl
Commits
6cc114b0
Commit
6cc114b0
authored
10 years ago
by
schulmax
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Adds support for binary property fields
parent
f09558a8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hshetl/entities.py
+11
-0
11 additions, 0 deletions
hshetl/entities.py
with
11 additions
and
0 deletions
hshetl/entities.py
+
11
−
0
View file @
6cc114b0
...
@@ -263,6 +263,8 @@ class PropertyConverter(object):
...
@@ -263,6 +263,8 @@ class PropertyConverter(object):
elif
datatype
==
'
datetime
'
:
elif
datatype
==
'
datetime
'
:
if
type
(
raw_value
)
==
datetime
.
datetime
:
if
type
(
raw_value
)
==
datetime
.
datetime
:
return
raw_value
return
raw_value
elif
datatype
==
'
binary
'
:
return
self
.
_convert_binary
(
raw_value
)
# TODO: make datetime conversion possible
# TODO: make datetime conversion possible
# datetime_format = self.datetime_format[prop]
# datetime_format = self.datetime_format[prop]
# return self._convert_datetime(raw_value, datetime_format)
# return self._convert_datetime(raw_value, datetime_format)
...
@@ -337,6 +339,15 @@ class PropertyConverter(object):
...
@@ -337,6 +339,15 @@ class PropertyConverter(object):
if
value
==
''
:
return
None
if
value
==
''
:
return
None
return
datetime
.
datetime
.
strptime
(
value
,
datetime_format
)
return
datetime
.
datetime
.
strptime
(
value
,
datetime_format
)
def
_convert_binary
(
self
,
value
):
'''
Converts incoming value to binary
'''
if
type
(
value
)
==
buffer
:
return
value
elif
type
(
value
)
==
int
:
return
bin
(
value
)
elif
type
(
value
)
==
str
and
value
==
''
:
return
value
class
Record
(
object
):
class
Record
(
object
):
'''
Records merge and store data from extractions
'''
Records merge and store data from extractions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment