-
Notifications
You must be signed in to change notification settings - Fork 1
Do not include TZ information in queries #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Same as twingly/twingly-search-api-ruby#69. Re-record fixtures to get fixtures without published time bugs.
| ], | ||
| "recorded_with": "betamax/0.8.0" | ||
| } No newline at end of file | ||
| {"http_interactions": [{"request": {"body": {"string": "", "encoding": "utf-8"}, "headers": {"Connection": "keep-alive", "Accept-Encoding": "gzip, deflate", "Accept": "*/*", "User-Agent": "Twingly Search Python Client/2.1.0"}, "method": "GET", "uri": "https://api.twingly.com/blog/search/api/v3/search?q=something&apiKey=wrong"}, "response": {"body": {"string": "<?xml version=\"1.0\" encoding=\"utf-8\"?><error code=\"40101\"><message>Unauthorized</message></error>", "encoding": "utf-8"}, "headers": {"Content-Length": "97", "Expires": "-1", "Server": "nginx", "Connection": "keep-alive", "Pragma": "no-cache", "Cache-Control": "no-cache", "Date": "Mon, 16 Oct 2017 08:54:09 GMT", "Content-Type": "application/xml; charset=utf-8"}, "status": {"message": "Unauthorized", "code": 401}, "url": "https://api.twingly.com/blog/search/api/v3/search?q=something&apiKey=wrong"}, "recorded_at": "2017-10-16T08:54:09"}], "recorded_with": "betamax/0.5.1"} No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I should probably update my betamax so get nicer output :) cough #11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't matter, maybe it's Windows vs macOS thing.
… with newer betamax to get nicer output
tests/test_query.py
Outdated
| q.start_time = self.datetime_with_timezone(datetime(2012, 12, 28, 9, 1, 22), "UTC") | ||
| query_string = q.build_query_string() | ||
| self.assertEqual(query_string, "spotify start-date:2012-12-28T09:01:22Z") | ||
| self.assertEqual(query_string, "spotify start-date:2012-12-28 09:01:22") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be "spotify start-date:\"2012-12-28 09:01:22\"" (surrounded by quotes) now that the timestamp contains a space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think, the request sent will actually include %20 (or +). Also take a look at what we had before: 4e4ef2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yeah, I see our docs includes quoting, but I don't think it's necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, investigated some more. Seems like you are right. We probably have this bug in most of clients. Nice catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a T between the date and the time parts works as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a T between the date and the time parts works as well.
Yes, seems to be working. I am thinking we should possibly update our developer site to prefer this over quoting. Should be easier for customers and also easier for us when reading logs.
See #38 (comment) r144828545
With great search and replace comes great responsibility.
Do not include timezone information in queries (#38)
Same as twingly/twingly-search-api-ruby#69.
Re-record fixtures to get fixtures without published time bugs.