Skip to content

Commit

Permalink
simplify dup code
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchenglin committed Jan 17, 2025
1 parent 0ddb5d3 commit 52c97bf
Showing 1 changed file with 4 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,41 +331,14 @@ public override IReadOnlyList<string> GetKeyColumns()
}
}

internal class TestNonDelegableDataSource : TestDataSource
{
private readonly TabularDataQueryOptions _queryOptions;
private readonly IDelegationMetadata _delegationMetadata;
private readonly bool _isPageable;

internal class TestNonDelegableDataSource : TestDelegableDataSource
{
internal TestNonDelegableDataSource(string name, DType schema, IDelegationMetadata delegationMetadata, bool isPageable = false)
: base(name, schema)
: base(name, schema, delegationMetadata, isPageable)
{
_queryOptions = new TabularDataQueryOptions(this);
_delegationMetadata = delegationMetadata;
_isPageable = isPageable;
}

public override bool IsSelectable => true;
}

public override bool IsDelegatable => false;

public override bool IsPageable => _isPageable;

public override bool CanIncludeSelect(string selectColumnName)
{
return true;
}

public override TabularDataQueryOptions QueryOptions => new TabularDataQueryOptions(this);

public override IDelegationMetadata DelegationMetadata => _delegationMetadata;

public override DataSourceKind Kind => DataSourceKind.Connected;

public override IReadOnlyList<string> GetKeyColumns()
{
return new List<string>();
}
}

internal class TestExpandInfo : IExpandInfo
Expand Down

0 comments on commit 52c97bf

Please sign in to comment.