@@ -79,7 +79,24 @@ def _sum_counts(base_count, dep_to_count, parent_to_count):
7979def get_previous_pypi_downloads (input_file , output_folder , dry_run ):
8080 """Read pypi.csv and return a DataFrame of the downloads."""
8181 csv_path = input_file or get_path (output_folder , 'pypi.csv' )
82- return load_csv (csv_path , dry_run = dry_run )
82+ read_csv_kwargs = {
83+ 'parse_dates' : ['timestamp' ],
84+ 'dtype' : {
85+ 'country_code' : pd .CategoricalDtype (),
86+ 'project' : pd .CategoricalDtype (),
87+ 'version' : pd .CategoricalDtype (),
88+ 'type' : pd .CategoricalDtype (),
89+ 'installer_name' : pd .CategoricalDtype (),
90+ 'implementation_name' : pd .CategoricalDtype (),
91+ 'implementation_version' : pd .CategoricalDtype (),
92+ 'distro_name' : pd .CategoricalDtype (),
93+ 'distro_version' : pd .CategoricalDtype (),
94+ 'system_name' : pd .CategoricalDtype (),
95+ 'system_release' : pd .CategoricalDtype (),
96+ 'cpu' : pd .CategoricalDtype (),
97+ },
98+ }
99+ return load_csv (csv_path , read_csv_kwargs = read_csv_kwargs )
83100
84101
85102def _ecosystem_count_by_year (downloads , base_project , dependency_projects , parent_projects ):
0 commit comments