workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
``` book_addition_pool.apply_async( self._add_books, ( book_list[start_index:start_index+maximum_batch_size], maximum_batch_size ) ) ```
2019-04-02T07:33:31.156800
Valeri
pythondev_help_Valeri_2019-04-02T07:33:31.156800
1,554,190,411.1568
16,521
pythondev
help
This adds a task to my celery queue called `create_books`
2019-04-02T07:33:51.157300
Valeri
pythondev_help_Valeri_2019-04-02T07:33:51.157300
1,554,190,431.1573
16,522
pythondev
help
what is `_add_books`?
2019-04-02T07:33:59.157700
Hiroko
pythondev_help_Hiroko_2019-04-02T07:33:59.157700
1,554,190,439.1577
16,523
pythondev
help
anyway, that does look _really_ convoluted
2019-04-02T07:34:13.158300
Hiroko
pythondev_help_Hiroko_2019-04-02T07:34:13.158300
1,554,190,453.1583
16,524
pythondev
help
It's a function doing the bulk_create
2019-04-02T07:34:15.158600
Valeri
pythondev_help_Valeri_2019-04-02T07:34:15.158600
1,554,190,455.1586
16,525
pythondev
help
and must be a pain to test
2019-04-02T07:34:17.158700
Hiroko
pythondev_help_Hiroko_2019-04-02T07:34:17.158700
1,554,190,457.1587
16,526
pythondev
help
How do you suggest I simplify this?
2019-04-02T07:34:36.159000
Valeri
pythondev_help_Valeri_2019-04-02T07:34:36.159000
1,554,190,476.159
16,527
pythondev
help
Basically I have to do an asynchronous `bulk_create`
2019-04-02T07:35:01.159600
Valeri
pythondev_help_Valeri_2019-04-02T07:35:01.159600
1,554,190,501.1596
16,528
pythondev
help
The API literally dies for records more than 50k
2019-04-02T07:35:21.160400
Valeri
pythondev_help_Valeri_2019-04-02T07:35:21.160400
1,554,190,521.1604
16,529
pythondev
help
what’s the problem there?
2019-04-02T07:35:48.160900
Hiroko
pythondev_help_Hiroko_2019-04-02T07:35:48.160900
1,554,190,548.1609
16,530
pythondev
help
is it the db?
2019-04-02T07:35:55.161300
Hiroko
pythondev_help_Hiroko_2019-04-02T07:35:55.161300
1,554,190,555.1613
16,531
pythondev
help
broker?
2019-04-02T07:35:56.161500
Hiroko
pythondev_help_Hiroko_2019-04-02T07:35:56.161500
1,554,190,556.1615
16,532
pythondev
help
worker?
2019-04-02T07:36:00.161700
Hiroko
pythondev_help_Hiroko_2019-04-02T07:36:00.161700
1,554,190,560.1617
16,533
pythondev
help
The serializer is heavy
2019-04-02T07:36:01.161800
Valeri
pythondev_help_Valeri_2019-04-02T07:36:01.161800
1,554,190,561.1618
16,534
pythondev
help
Has very complex business logic involved
2019-04-02T07:36:16.162100
Valeri
pythondev_help_Valeri_2019-04-02T07:36:16.162100
1,554,190,576.1621
16,535
pythondev
help
gotcha
2019-04-02T07:36:26.162300
Hiroko
pythondev_help_Hiroko_2019-04-02T07:36:26.162300
1,554,190,586.1623
16,536
pythondev
help
but what do you mean “the api literally dies for records more than 50k”?
2019-04-02T07:38:01.163100
Hiroko
pythondev_help_Hiroko_2019-04-02T07:38:01.163100
1,554,190,681.1631
16,537
pythondev
help
do you mean inserts?
2019-04-02T07:38:10.163400
Hiroko
pythondev_help_Hiroko_2019-04-02T07:38:10.163400
1,554,190,690.1634
16,538
pythondev
help
retrievals (if so, why aren’t you using pagination?)
2019-04-02T07:38:23.163800
Hiroko
pythondev_help_Hiroko_2019-04-02T07:38:23.163800
1,554,190,703.1638
16,539
pythondev
help
Creation takes time
2019-04-02T07:38:38.164100
Valeri
pythondev_help_Valeri_2019-04-02T07:38:38.164100
1,554,190,718.1641
16,540
pythondev
help
Retrieval is paginated ofc
2019-04-02T07:38:48.164400
Valeri
pythondev_help_Valeri_2019-04-02T07:38:48.164400
1,554,190,728.1644
16,541
pythondev
help
you’d be surprised at how many people don’t do that
2019-04-02T07:39:06.164900
Hiroko
pythondev_help_Hiroko_2019-04-02T07:39:06.164900
1,554,190,746.1649
16,542
pythondev
help
where’s the bottleneck?
2019-04-02T07:39:34.165600
Hiroko
pythondev_help_Hiroko_2019-04-02T07:39:34.165600
1,554,190,774.1656
16,543
pythondev
help
is it your db?
2019-04-02T07:39:37.165800
Hiroko
pythondev_help_Hiroko_2019-04-02T07:39:37.165800
1,554,190,777.1658
16,544
pythondev
help
your celery broker?
2019-04-02T07:39:47.166200
Hiroko
pythondev_help_Hiroko_2019-04-02T07:39:47.166200
1,554,190,787.1662
16,545
pythondev
help
I think you're missing the point here
2019-04-02T07:40:26.167000
Valeri
pythondev_help_Valeri_2019-04-02T07:40:26.167000
1,554,190,826.167
16,546
pythondev
help
I have to get this done asynchronously
2019-04-02T07:40:39.167300
Valeri
pythondev_help_Valeri_2019-04-02T07:40:39.167300
1,554,190,839.1673
16,547
pythondev
help
and celery will do that for you
2019-04-02T07:40:53.167700
Hiroko
pythondev_help_Hiroko_2019-04-02T07:40:53.167700
1,554,190,853.1677
16,548
pythondev
help
There is no way I can improve my API's performance
2019-04-02T07:40:55.167900
Valeri
pythondev_help_Valeri_2019-04-02T07:40:55.167900
1,554,190,855.1679
16,549
pythondev
help
So, I wasn't using celery until now
2019-04-02T07:41:16.168200
Valeri
pythondev_help_Valeri_2019-04-02T07:41:16.168200
1,554,190,876.1682
16,550
pythondev
help
ahhhhh
2019-04-02T07:41:23.168600
Hiroko
pythondev_help_Hiroko_2019-04-02T07:41:23.168600
1,554,190,883.1686
16,551
pythondev
help
ok
2019-04-02T07:41:24.168800
Hiroko
pythondev_help_Hiroko_2019-04-02T07:41:24.168800
1,554,190,884.1688
16,552
pythondev
help
so, executing a celery task in the command line is the same you’d do in a view
2019-04-02T07:43:00.169200
Hiroko
pythondev_help_Hiroko_2019-04-02T07:43:00.169200
1,554,190,980.1692
16,553
pythondev
help
best praactices is to have the task defined in a `tasks.py` file
2019-04-02T07:43:26.169700
Hiroko
pythondev_help_Hiroko_2019-04-02T07:43:26.169700
1,554,191,006.1697
16,554
pythondev
help
where you can import it
2019-04-02T07:43:32.169900
Hiroko
pythondev_help_Hiroko_2019-04-02T07:43:32.169900
1,554,191,012.1699
16,555
pythondev
help
and then generate the data you need to execute said task
2019-04-02T07:43:44.170200
Hiroko
pythondev_help_Hiroko_2019-04-02T07:43:44.170200
1,554,191,024.1702
16,556
pythondev
help
in this case, you’d have to figure out what the response for `self._add_books`, `book_list`, and `maximum_batch_size` are
2019-04-02T07:44:43.171400
Hiroko
pythondev_help_Hiroko_2019-04-02T07:44:43.171400
1,554,191,083.1714
16,557
pythondev
help
Thank you so much! I did some test trying the generator expression and now I understand better :smile:
2019-04-02T09:01:35.171900
Antoine
pythondev_help_Antoine_2019-04-02T09:01:35.171900
1,554,195,695.1719
16,558
pythondev
help
<@Sparkle> Thanks for your reply :slightly_smiling_face: . I was able to fix this by using '\n;' as line_terminator and ';'as delimiter. the whole issue was caused by using ; as delimiter and ; as line_terminator, which resulted in a very long line of data. where did you find these expressions?
2019-04-02T09:37:59.172500
Kathline
pythondev_help_Kathline_2019-04-02T09:37:59.172500
1,554,197,879.1725
16,559
pythondev
help
Flask Restful question: I am receiving a 404 when I use `<http://requests.post|requests.post>()` but a 200 when I `curl` the endpoint. My endpoint in Flask is as follows. ```class Endpoint(Resource): def post(self, call): print(call) return 200``` I set up my Resource as follows. ```api.add_resource(Endpoint, "/&lt;call&gt;") ``` So, this works `curl -X POST 127.0.0.1:5000/Hi` but this returns a 404 `r = <http://requests.post|requests.post>(ENDPOINT, json=payload_dict)` where ENDPOINT is <http://127.0.0.1:5000>
2019-04-02T09:49:20.175100
Lawrence
pythondev_help_Lawrence_2019-04-02T09:49:20.175100
1,554,198,560.1751
16,560
pythondev
help
I've also tried replacing the `json` param with `data` to no avail
2019-04-02T09:50:18.175500
Lawrence
pythondev_help_Lawrence_2019-04-02T09:50:18.175500
1,554,198,618.1755
16,561
pythondev
help
what’s your payload dict?
2019-04-02T09:52:54.176800
Hiroko
pythondev_help_Hiroko_2019-04-02T09:52:54.176800
1,554,198,774.1768
16,562
pythondev
help
This seems like a POST data vs URL params issue.
2019-04-02T09:53:00.177100
Carmen
pythondev_help_Carmen_2019-04-02T09:53:00.177100
1,554,198,780.1771
16,563
pythondev
help
a 400 is a bad request
2019-04-02T09:53:02.177300
Hiroko
pythondev_help_Hiroko_2019-04-02T09:53:02.177300
1,554,198,782.1773
16,564
pythondev
help
payload dict is kust a key:value dictionary
2019-04-02T09:53:21.178100
Lawrence
pythondev_help_Lawrence_2019-04-02T09:53:21.178100
1,554,198,801.1781
16,565
pythondev
help
Your URL for the `requests` call isn't matching your Flask route.
2019-04-02T09:53:22.178400
Carmen
pythondev_help_Carmen_2019-04-02T09:53:22.178400
1,554,198,802.1784
16,566
pythondev
help
I'm able to print it out just fine - it looks correctly formatted
2019-04-02T09:53:32.178900
Lawrence
pythondev_help_Lawrence_2019-04-02T09:53:32.178900
1,554,198,812.1789
16,567
pythondev
help
```127.0.0.1:5000/Hi``` suggests this is a route
2019-04-02T09:53:34.179000
Hiroko
pythondev_help_Hiroko_2019-04-02T09:53:34.179000
1,554,198,814.179
16,568
pythondev
help
POST does not put the parameters in the URL.
2019-04-02T09:53:34.179100
Carmen
pythondev_help_Carmen_2019-04-02T09:53:34.179100
1,554,198,814.1791
16,569
pythondev
help
<@Hiroko> Hi is the `&lt;call&gt;` variable in this case
2019-04-02T09:54:02.179900
Lawrence
pythondev_help_Lawrence_2019-04-02T09:54:02.179900
1,554,198,842.1799
16,570
pythondev
help
<@Carmen> I believe you are right but I can't determine the proper route format
2019-04-02T09:54:17.180500
Lawrence
pythondev_help_Lawrence_2019-04-02T09:54:17.180500
1,554,198,857.1805
16,571
pythondev
help
So when you're using `ENDPOINT = <http://127.0.0.1:5000>`, you're making a call to that specific URL with POST data. You need to either modify `ENDPOINT` to have the `call` URL parameter, or adjust your route in Flask to not require it and instead to pull that data from the request POST data.
2019-04-02T09:55:17.181500
Carmen
pythondev_help_Carmen_2019-04-02T09:55:17.181500
1,554,198,917.1815
16,572
pythondev
help
ah I see
2019-04-02T09:55:55.181900
Lawrence
pythondev_help_Lawrence_2019-04-02T09:55:55.181900
1,554,198,955.1819
16,573
pythondev
help
Which you do depends on whether `call` is something that you were specifying in your payload or not.
2019-04-02T09:56:08.182400
Carmen
pythondev_help_Carmen_2019-04-02T09:56:08.182400
1,554,198,968.1824
16,574
pythondev
help
so `ENDPOINT = ...:5000/?call=`?
2019-04-02T09:56:18.182700
Lawrence
pythondev_help_Lawrence_2019-04-02T09:56:18.182700
1,554,198,978.1827
16,575
pythondev
help
Just `ENDPOINT = <http://127.0.0.1:5000/Hi>`
2019-04-02T09:56:37.183000
Carmen
pythondev_help_Carmen_2019-04-02T09:56:37.183000
1,554,198,997.183
16,576
pythondev
help
I was under the impression the `json` would be appended to the route as the POST data string but I now believe that is not correct
2019-04-02T09:58:03.184100
Lawrence
pythondev_help_Lawrence_2019-04-02T09:58:03.184100
1,554,199,083.1841
16,577
pythondev
help
I'll look into parsing POST data via Flask restful then
2019-04-02T09:58:14.184600
Lawrence
pythondev_help_Lawrence_2019-04-02T09:58:14.184600
1,554,199,094.1846
16,578
pythondev
help
That is not correct for POST calls. Almost every HTTP request framework is going to not append the POST data to the URL. It's going to pass it as actual POST data in the request body.
2019-04-02T09:59:03.185600
Carmen
pythondev_help_Carmen_2019-04-02T09:59:03.185600
1,554,199,143.1856
16,579
pythondev
help
its added to the _body_ of the rewquest
2019-04-02T09:59:05.185700
Hiroko
pythondev_help_Hiroko_2019-04-02T09:59:05.185700
1,554,199,145.1857
16,580
pythondev
help
not the route
2019-04-02T09:59:09.185900
Hiroko
pythondev_help_Hiroko_2019-04-02T09:59:09.185900
1,554,199,149.1859
16,581
pythondev
help
I see
2019-04-02T09:59:19.186300
Lawrence
pythondev_help_Lawrence_2019-04-02T09:59:19.186300
1,554,199,159.1863
16,582
pythondev
help
GET adds to the route with query params
2019-04-02T09:59:19.186400
Hiroko
pythondev_help_Hiroko_2019-04-02T09:59:19.186400
1,554,199,159.1864
16,583
pythondev
help
^
2019-04-02T09:59:24.186600
Carmen
pythondev_help_Carmen_2019-04-02T09:59:24.186600
1,554,199,164.1866
16,584
pythondev
help
cool - good to know, thanks! <@Hiroko> <@Carmen> :taco:
2019-04-02T09:59:37.186900
Lawrence
pythondev_help_Lawrence_2019-04-02T09:59:37.186900
1,554,199,177.1869
16,585
pythondev
help
parsing the request body worked :thumbsup: thanks again for your help
2019-04-02T10:26:22.187200
Lawrence
pythondev_help_Lawrence_2019-04-02T10:26:22.187200
1,554,200,782.1872
16,586
pythondev
help
Does anyone will support for AWS with python project ?
2019-04-02T11:37:45.188400
Karl
pythondev_help_Karl_2019-04-02T11:37:45.188400
1,554,205,065.1884
16,587
pythondev
help
Knowing how to ask a good question is a highly invaluable skill that will benefit you greatly in any career. Two good resources for suggestions and strategies to help you structure and phrase your question to make it easier for those here to understand your problem and help you work to a solution are: • <https://www.mikeash.com/getting_answers.html> • <https://stackoverflow.com/help/how-to-ask>
2019-04-02T11:40:17.188500
Leana
pythondev_help_Leana_2019-04-02T11:40:17.188500
1,554,205,217.1885
16,588
pythondev
help
<@Karl> your questions is very vague. Can you be more specific with the issue you're having?
2019-04-02T11:45:37.189200
Ashley
pythondev_help_Ashley_2019-04-02T11:45:37.189200
1,554,205,537.1892
16,589
pythondev
help
Auto remidation script for security groups
2019-04-02T11:53:16.190100
Karl
pythondev_help_Karl_2019-04-02T11:53:16.190100
1,554,205,996.1901
16,590
pythondev
help
<@Karl> if you want help, being limited with details and descriptions is a good way to not get it
2019-04-02T11:55:54.190600
Hiroko
pythondev_help_Hiroko_2019-04-02T11:55:54.190600
1,554,206,154.1906
16,591
pythondev
help
it helps if you tell us exactly what you're looking to accomplish, what you've tried, and issues that are blocking you
2019-04-02T12:08:13.191500
Ashley
pythondev_help_Ashley_2019-04-02T12:08:13.191500
1,554,206,893.1915
16,592
pythondev
help
Sorry <@Izetta> for late reply - was in hospital all last week - if you still need an answer try this `'//a[@class="result algolia-clearfix"]/@href'` it worked in console - you dont need the contains portion because the exact class _is_ `result algolia-clearfix`
2019-04-02T12:14:20.191600
Sparkle
pythondev_help_Sparkle_2019-04-02T12:14:20.191600
1,554,207,260.1916
16,593
pythondev
help
i didnt find them per se - just years and years of working with csv files and excel ( i hate excel it always corrupts perfectly good files )
2019-04-02T12:15:27.191900
Sparkle
pythondev_help_Sparkle_2019-04-02T12:15:27.191900
1,554,207,327.1919
16,594
pythondev
help
I have roughly around 1000 lines typed and it contains some sensitive (or could be sensitive) information. I was curious if there are any people/services that are trustworthy to look at my code briefly to offer suggestions or criticism? I am far from finishing it, but curious what people would think to help me improve as I am finishing the program. Note: It involves Tkinter P 3.0.
2019-04-02T14:09:31.195600
Nenita
pythondev_help_Nenita_2019-04-02T14:09:31.195600
1,554,214,171.1956
16,595
pythondev
help
can you move the sensitive information into env variables and then share the code here for review?
2019-04-02T14:10:54.196300
Clemmie
pythondev_help_Clemmie_2019-04-02T14:10:54.196300
1,554,214,254.1963
16,596
pythondev
help
thats why when i said 'could be sensitive', it's more of names of headers. Let me redact some stuff real quick.
2019-04-02T14:18:08.197400
Nenita
pythondev_help_Nenita_2019-04-02T14:18:08.197400
1,554,214,688.1974
16,597
pythondev
help
umm, how am i suppose to post this much code?
2019-04-02T14:19:06.197700
Nenita
pythondev_help_Nenita_2019-04-02T14:19:06.197700
1,554,214,746.1977
16,598
pythondev
help
snippet
2019-04-02T14:19:13.198000
Clemmie
pythondev_help_Clemmie_2019-04-02T14:19:13.198000
1,554,214,753.198
16,599
pythondev
help
plus their spread across 3 modules
2019-04-02T14:19:16.198100
Nenita
pythondev_help_Nenita_2019-04-02T14:19:16.198100
1,554,214,756.1981
16,600
pythondev
help
ahh- harder. could you throw up a quick gitlab project and point to it?
2019-04-02T14:20:01.198900
Clemmie
pythondev_help_Clemmie_2019-04-02T14:20:01.198900
1,554,214,801.1989
16,601
pythondev
help
yea. never had a git account, but been wanting to make one to post my code for criticism more or less
2019-04-02T14:20:33.199600
Nenita
pythondev_help_Nenita_2019-04-02T14:20:33.199600
1,554,214,833.1996
16,602
pythondev
help
un momento
2019-04-02T14:20:39.199800
Nenita
pythondev_help_Nenita_2019-04-02T14:20:39.199800
1,554,214,839.1998
16,603
pythondev
help
A gist can help
2019-04-02T14:23:08.200000
Jonas
pythondev_help_Jonas_2019-04-02T14:23:08.200000
1,554,214,988.2
16,604
pythondev
help
<https://gist.github.com/> you can have multiple files.
2019-04-02T14:23:22.200300
Jonas
pythondev_help_Jonas_2019-04-02T14:23:22.200300
1,554,215,002.2003
16,605
pythondev
help
So i just signed up for gitlab (not sure whats the difference from github), but after creating a new project and ready to type code, i notice a lot of git keywords everywhere. am i able to copy and paste python code?
2019-04-02T14:27:57.201400
Nenita
pythondev_help_Nenita_2019-04-02T14:27:57.201400
1,554,215,277.2014
16,606
pythondev
help
<@Nenita> gitlab uses `git` just like GitHub. It has a lot of the same features as GitHub (e.g. forking, PRs, issues, code review), as well as a few other additional things that GitHub doesn't have (e.g. built in CI/CD pipeline)
2019-04-02T14:33:50.203700
Ashley
pythondev_help_Ashley_2019-04-02T14:33:50.203700
1,554,215,630.2037
16,607
pythondev
help
when logging using using `logging` lib, isn't it best practice to use parameters in your message instead of `format`? e.g. `logger.debug("This %s", "logger")`
2019-04-02T14:34:14.204600
Lawrence
pythondev_help_Lawrence_2019-04-02T14:34:14.204600
1,554,215,654.2046
16,608
pythondev
help
but functional with python as well?
2019-04-02T14:34:22.205100
Nenita
pythondev_help_Nenita_2019-04-02T14:34:22.205100
1,554,215,662.2051
16,609
pythondev
help
<@Lawrence> checkout out f-strings
2019-04-02T14:35:15.205900
Claudine
pythondev_help_Claudine_2019-04-02T14:35:15.205900
1,554,215,715.2059
16,610
pythondev
help
the new new
2019-04-02T14:35:17.206200
Claudine
pythondev_help_Claudine_2019-04-02T14:35:17.206200
1,554,215,717.2062
16,611
pythondev
help
also, GitHub caught a LOT of flack a while back for changes in their policies that caused people to flock from it. For example, they made a change to their CoC that said it's better to accept code that is worse in quality if it's from someone in an underrepresented group than it is to accept better code from someone who isn't in an underrepresented group
2019-04-02T14:35:45.206900
Ashley
pythondev_help_Ashley_2019-04-02T14:35:45.206900
1,554,215,745.2069
16,612
pythondev
help
oof
2019-04-02T14:36:05.207100
Claudine
pythondev_help_Claudine_2019-04-02T14:36:05.207100
1,554,215,765.2071
16,613
pythondev
help
limited to 2.7 currently and I believe even still the parameterization is preferred according to docs
2019-04-02T14:36:08.207200
Lawrence
pythondev_help_Lawrence_2019-04-02T14:36:08.207200
1,554,215,768.2072
16,614
pythondev
help
yea i think you're correct
2019-04-02T14:36:20.207400
Claudine
pythondev_help_Claudine_2019-04-02T14:36:20.207400
1,554,215,780.2074
16,615
pythondev
help
guess ill learn more as i begin to use it more
2019-04-02T14:37:24.207900
Nenita
pythondev_help_Nenita_2019-04-02T14:37:24.207900
1,554,215,844.2079
16,616
pythondev
help
Orthogonal to it. Git is a distributed version control system. It doesn't really have anything to do with your code.
2019-04-02T14:38:22.209100
Clemmie
pythondev_help_Clemmie_2019-04-02T14:38:22.209100
1,554,215,902.2091
16,617
pythondev
help
anyhow, im almost finished uploading it. by the way, because the code uses a few csv files, you (whomever) may not be able to run it off the bat. If need be, i can see if i can make some quick adjustments to get it running without those csv files. really im just looking for criticism on the code rather than the actual gui, etc.
2019-04-02T14:38:33.209500
Nenita
pythondev_help_Nenita_2019-04-02T14:38:33.209500
1,554,215,913.2095
16,618
pythondev
help
Learning git will be an excellent addition to your skillset
2019-04-02T14:39:09.210300
Clemmie
pythondev_help_Clemmie_2019-04-02T14:39:09.210300
1,554,215,949.2103
16,619
pythondev
help
you can read up on the general disaster that was here <https://www.reddit.com/r/OutOfTheLoop/comments/47ksmz/what_is_going_on_with_github/>
2019-04-02T14:39:16.210600
Ashley
pythondev_help_Ashley_2019-04-02T14:39:16.210600
1,554,215,956.2106
16,620