Comments (7)
There's a bit of history with that, I guess this format is not supported on python 3.7.
For now its best to stay on 3.5.x unless there's some overriding reason not to be on that version of python.
from singer-python.
Ah ok, I was not aware about 3.7 support. So this is what I am facing
>>> from datetime import datetime
>>> from singer import utils
>>> import pytz
>>> utc = pytz.UTC
>>> now = datetime.utcnow().replace(tzinfo=utc)
>>> dtime = utils.strftime(now)
>>> utils.strptime(dtime)
ValueError: time data '2018-10-19T20:53:38.514627Z' does not match format '%Y-%m-%dT%H:%M:%SZ'
In short I can not get the datetime back with formatted string. The problem is because of
Line 27 in f6c5227
from singer-python.
Also locally I am running python 3.7 but this error is coming on stitchdata running on python 3.5. Let me know, happy to send a fix.
from singer-python.
I need to know some more details about the error your seeing.
- Can you provide logs for python 3.5 running into this issue?
- Can you tell me the platform details that you're seeing this on? Docker? Virtual Machine? AWS? What distribution are you using, how did you install python 3.5, etc.
I'm going to do a bit of digging myself but at the moment I suspect that the underlying C library is actually what's throwing this error.
from singer-python.
So it appears that you've uncovered an asymmetry between utils.strptime
and utils.strftime
. I'm unsure how long this asymmetry has existed but it's not great and unfortunately because that code hasn't changed for so long it's also not something that's going to be easy to fix.
That said, it appears if you use utils.striptime_to_utc
it will DTRT.
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> from singer import utils
>>>
>>> utils.strptime_to_utc(utils.strftime(utils.now()))
datetime.datetime(2018, 10, 22, 16, 26, 15, 917887, tzinfo=<UTC>)
# => datetime.datetime(2018, 10, 22, 16, 26, 15, 917887, tzinfo=<UTC>)
We (or you via a PR) may take the step to deprecate utils.strptime
entirely at some point. The presence of these 4 functions is certainly confusing. I believe based on an internal conversation that it's possible utils.strptime
was informally deprecated.
from singer-python.
@timvisher thank you for the explanation, I will send a PR as soon I get time.
from singer-python.
#82 closes this issue.
from singer-python.
Related Issues (20)
- Incompatible taps & targets HOT 4
- Support for inline configuration strings HOT 6
- `log_debug` cannot work...for very long HOT 3
- Bump pytz version to >= 2018.9 HOT 1
- Ratelimit helper does not support multi-threading or async
- Schema fails to be turned into dictionary if it contains "anyOf"
- 5.9.0: Transformer.filter_data_by_metadata() doesn't filter unselected nodes where selected unspecified HOT 1
- Feature Request: Add support for --stream_name argument HOT 1
- Messages are not valid JSON
- Transformer dumps JSON incompatible string
- Async support
- JSONSchema Draft 7 array Tuple Validation unsupported? Schema.from_dict() raise exception HOT 1
- Add UTF-8 validity checking to schema
- Support Draft 7 validation keys in object schemas
- --catalog vs -p (properties) parameters HOT 4
- Loosen version spec in setup.py HOT 4
- use singer taps and targets programatically HOT 5
- Invalid format string %04Y on Windows HOT 8
- Is requirement for backoff==1.3.2 necessary HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from singer-python.