Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
A
alem-ru-clustering
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeldar Toktasynov
alem-ru-clustering
Commits
a1da3ab3
Commit
a1da3ab3
authored
Feb 04, 2022
by
Yeldar Toktasynov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing query to retrieve only strong clusters
parent
0cbcfa34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
app.py
app.py
+7
-2
No files found.
app.py
View file @
a1da3ab3
...
...
@@ -8,7 +8,7 @@ from db_cluster import table_class, create_session
import
uuid
import
pandas
as
pd
from
sys
import
getsizeof
from
sqlalchemy
import
or_
,
and_
logging
.
basicConfig
(
format
=
"
%(asctime)
s
%(message)
s"
)
...
...
@@ -32,7 +32,12 @@ logging.info(msg=f"Начало Первого запроса в базу")
session
=
create_session
(
**
app
.
config
[
'postgres'
])
Class_Table_Name
=
table_class
(
app
.
config
[
'postgres'
]
.
get
(
'table_name'
))
df
=
pd
.
read_sql
(
session
.
query
(
Class_Table_Name
.
cluster_id
,
Class_Table_Name
.
count
,
Class_Table_Name
.
centroid
)
.
filter
(
Class_Table_Name
.
is_actual
==
True
,
Class_Table_Name
.
language
==
'ru'
)
.
statement
,
session
.
bind
)
.
filter
(
Class_Table_Name
.
is_actual
==
True
,
Class_Table_Name
.
language
==
'ru'
)
.
filter
(
or_
(
Class_Table_Name
.
count
!=
0
,
and_
(
Class_Table_Name
.
count
==
0
,
Class_Table_Name
.
created_date
>
datetime
.
today
()
-
timedelta
(
days
=
30
))))
.
statement
,
session
.
bind
)
logging
.
info
(
msg
=
f
"Количество кластеров в рус: {len(df)} Size: {getsizeof(df)}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment