MCPcopy Create free account
hub / github.com/apache/datafusion / check

Function check

datafusion/catalog/src/async.rs:489–514  ·  view source on GitHub ↗
(
            refs: Vec<TableReference>,
            expected_lookup_count: u32,
            found_tables: &[&str],
            not_found_tables: &[&str],
        )

Source from the content-addressed store, hash-verified

487 #[tokio::test]
488 async fn test_async_schema_provider_resolve() {
489 async fn check(
490 refs: Vec<TableReference>,
491 expected_lookup_count: u32,
492 found_tables: &[&str],
493 not_found_tables: &[&str],
494 ) {
495 let async_provider = MockAsyncSchemaProvider::default();
496 let cached_provider = async_provider
497 .resolve(&refs, &test_config(), MOCK_CATALOG, MOCK_SCHEMA)
498 .await
499 .unwrap();
500
501 assert_eq!(
502 async_provider.lookup_count.load(Ordering::Acquire),
503 expected_lookup_count
504 );
505
506 for table_ref in found_tables {
507 let table = cached_provider.table(table_ref).await.unwrap();
508 assert!(table.is_some());
509 }
510
511 for table_ref in not_found_tables {
512 assert!(cached_provider.table(table_ref).await.unwrap().is_none());
513 }
514 }
515
516 // Basic full lookups
517 check(

Calls 5

test_configFunction · 0.85
resolveMethod · 0.45
tableMethod · 0.45
schemaMethod · 0.45
catalogMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…