-
Notifications
You must be signed in to change notification settings - Fork 24
Send Job #18
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
base: main
Are you sure you want to change the base?
Send Job #18
Conversation
search emp by region,department,nationality
หมายถึงยังไงครับ @annibuliful ทำไมถึง invalid ครับ |
https://lxml.de/ ตัวนี้เป็น library ที่ต้อง install ถึงจะใช้งานได้ซึ่งผิดกฎที่เราได้แจ้งไว้ใน live ครับ |
Lib ตัวนี้ใช้ read data ส่วน ขั้นตอน transform เป็น logic นะครับ @annibuliful ที่เขียนไว้คือ convert to json. ไม่ใช่เหรอครับ แล้วมีเวลาให้แก้ถึงกี่โมงครับและอีกอย่างก็ไม่ได้เขียนห้ามลง package อื่นๆนอกจาก standard |
|
|
ตัวนี้ไม่ใช่ standard library นะครับ |
|
และโค๊ดของเหมือนของคนนี้เลย |
ข้อ 1 ส่วนใหญ่เป็น lib ที่มีลงไว้ทำพวก vistualize ครับ ลงตัวนึงมันก็มี dependency มา คราวหน้าเขียนรบกวน ระบุกฎให้มันชัดๆ เลยก็ดีนะครับ ว่าใช้ ได้แต่ standard lib อย่างอื่นห้าม ปล. ปล อีกอัน |
ถ้าทีมเดียวกันผมจะขอตรวขของคุณอย่างเดียวนะครับ |
|
|
งั้นผมขอปิด PR ของเพื่อนคุณและตรวจแค่ PR นะครับ |
ขอบคุณครับ ผมส่งรูป ที่ปรับเป็น element tree ซึ่งต่างกันไม่เยอะครับ XPath และได้ object ได้เหมือนกัน lxml obj.xpath xml ที่ส่งมาด้านบนคือการ travel node เอง ซึ่งเป็นวิธีดั้งเดิม แต่มีอีกวิธีที่นิยม คือ XPath ครับ แต่อาจจะเขียนต่างกันบางส่วนครับ ซึ่งปรับแล้วทำงานต่อจาก response ได้เลยครับ ส่วนเรื่อง pr สื่อสารกันในทีมไม่ดีเองครับ ขอโทษที่ทำให้สับสนครับ |
|
ได้ครับ เดี๋ยวจะเอาตรงจุดนี้ไปปรึษาากับทีมครับ ขอบคุณครับ |
| for i in range(500): | ||
| nationsResult.append([]) |
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 have no idea why you have to append empty array 500 items
| if(emp[6] not in nationIndex.keys()): | ||
| nationIndex[emp[6]]=index | ||
| currentIdex=nationIndex[emp[6]] | ||
| nationsResult[currentIdex].append(emp) | ||
| index=index+1 | ||
| else: | ||
| currentIdex=nationIndex[emp[6]] | ||
| nationsResult[currentIdex].append(emp) |
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.
It seems hard to read what is this logic using for
| if (exeType=='M'): | ||
| datasource = sys.argv[2] | ||
| dbName = sys.argv[3] | ||
| csvPath = sys.argv[4] | ||
| reportName = sys.argv[5] | ||
| config={ | ||
| "datasource":datasource, | ||
| "dbName":dbName, | ||
| "csvPath":csvPath, | ||
| "clubDataReport":reportName | ||
| } | ||
|
|
||
| startTime = time.perf_counter() | ||
|
|
||
| exe=Executor() | ||
| exe.setup(config) | ||
| exe.extract() | ||
| exe.transform() | ||
| exe.generateCSVByNationality() | ||
| # exe.load() | ||
| exe.loadFromCSV() | ||
| exe.generateSummary() | ||
|
|
||
|
|
||
| endTime = time.perf_counter() | ||
| totalTime = endTime - startTime | ||
| print(f'##Total used time {totalTime:.4f} seconds##') |
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.
instead of long code block condition I think you can wrap up with function it make more readable
| elif (exeType=='Q'): | ||
| dbName = sys.argv[2] | ||
| searchType = sys.argv[3] | ||
| valueSearch = sys.argv[4] | ||
| if(searchType!='' or valueSearch!=''): | ||
| config={ | ||
| "searchType":searchType, | ||
| "dbName":dbName, | ||
| "valueSearch":valueSearch | ||
| } | ||
| startTime = time.perf_counter() | ||
|
|
||
| exe=Executor() | ||
| exe.setup(config) | ||
| if searchType=='region': | ||
| exe.queryByRegion(valueSearch) | ||
| elif searchType=='dept': | ||
| exe.queryByDepartment(valueSearch) | ||
| elif searchType=='nationality': | ||
| exe.queryByNationality(valueSearch) | ||
| else: | ||
| print("Invalid Parameter!") | ||
| printInfoQ() | ||
| else: | ||
| print("Please enter Parameter!") | ||
| printInfoQ() | ||
| endTime = time.perf_counter() | ||
| totalTime = endTime - startTime | ||
| print(f'##Total used time {totalTime:.4f} seconds##') |
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.
Same here
| @@ -0,0 +1,83 @@ | |||
| import sqlite3 | |||
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 really love to this file it's very easy to read and understand
| import time | ||
| from datetime import datetime | ||
| from datetime import date | ||
| from dateutil import relativedelta |
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.
this is not allow to use
https://dateutil.readthedocs.io/en/stable/









Repository : our repository link
Visualize : visualize notebook
Json : Json
Team member