That’s the legacy importer, which will be removed in the future. The following code should be used instead, though it will only work if you run for git or wait until the next beta build.
from anki.collection import ImportAnkiPackageOptions, ImportAnkiPackageRequest
col.import_anki_package(
ImportAnkiPackageRequest(
package_path="/path/foo.apkg",
options=ImportAnkiPackageOptions(
with_scheduling=True, with_deck_configs=True
),
)
)