Skip to content

Commit

Permalink
remove obsolete grouping code from test_integration_queries.py
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasht86 committed Jan 13, 2025
1 parent a09afbe commit 119337c
Showing 1 changed file with 1 addition and 241 deletions.
242 changes: 1 addition & 241 deletions tests/integration/test_integration_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,34 +141,9 @@ def setUpClass(cls):
fieldsets=[fieldset],
)
schema.add_fields(emails_field, persons_field)
# Add purchase schema for grouping test
purchase_schema = Schema(
name="purchase",
document=Document(
fields=[
Field(name="date", type="long", indexing=["summary", "attribute"]),
Field(name="price", type="int", indexing=["summary", "attribute"]),
Field(name="tax", type="double", indexing=["summary", "attribute"]),
Field(
name="item", type="string", indexing=["summary", "attribute"]
),
Field(
name="customer",
type="string",
indexing=["summary", "attribute"],
),
]
),
rank_profiles=[
RankProfile(name="pricerank", first_phase="attribute(price)")
],
)
# Create the application package
application_package = ApplicationPackage(
name=application_name, schema=[schema, purchase_schema]
)
application_package = ApplicationPackage(name=application_name, schema=[schema])
print(application_package.get_schema(schema_name).schema_to_text)
print(application_package.get_schema("purchase").schema_to_text)
# Deploy the application
cls.vespa_docker = VespaDocker(port=8089)
cls.app = cls.vespa_docker.deploy(application_package=application_package)
Expand All @@ -179,221 +154,6 @@ def tearDownClass(cls):
cls.vespa_docker.container.stop(timeout=5)
cls.vespa_docker.container.remove()

@property
def sample_grouping_data(self):
sample_data = [
{
"fields": {
"customer": "Smith",
"date": 1157526000,
"item": "Intake valve",
"price": "1000",
"tax": "0.24",
},
"put": "id:purchase:purchase::0",
},
{
"fields": {
"customer": "Smith",
"date": 1157616000,
"item": "Rocker arm",
"price": "1000",
"tax": "0.12",
},
"put": "id:purchase:purchase::1",
},
{
"fields": {
"customer": "Smith",
"date": 1157619600,
"item": "Spring",
"price": "2000",
"tax": "0.24",
},
"put": "id:purchase:purchase::2",
},
{
"fields": {
"customer": "Jones",
"date": 1157709600,
"item": "Valve cover",
"price": "3000",
"tax": "0.12",
},
"put": "id:purchase:purchase::3",
},
{
"fields": {
"customer": "Jones",
"date": 1157702400,
"item": "Intake port",
"price": "5000",
"tax": "0.24",
},
"put": "id:purchase:purchase::4",
},
{
"fields": {
"customer": "Brown",
"date": 1157706000,
"item": "Head",
"price": "8000",
"tax": "0.12",
},
"put": "id:purchase:purchase::5",
},
{
"fields": {
"customer": "Smith",
"date": 1157796000,
"item": "Coolant",
"price": "1300",
"tax": "0.24",
},
"put": "id:purchase:purchase::6",
},
{
"fields": {
"customer": "Jones",
"date": 1157788800,
"item": "Engine block",
"price": "2100",
"tax": "0.12",
},
"put": "id:purchase:purchase::7",
},
{
"fields": {
"customer": "Brown",
"date": 1157792400,
"item": "Oil pan",
"price": "3400",
"tax": "0.24",
},
"put": "id:purchase:purchase::8",
},
{
"fields": {
"customer": "Smith",
"date": 1157796000,
"item": "Oil sump",
"price": "5500",
"tax": "0.12",
},
"put": "id:purchase:purchase::9",
},
{
"fields": {
"customer": "Jones",
"date": 1157875200,
"item": "Camshaft",
"price": "8900",
"tax": "0.24",
},
"put": "id:purchase:purchase::10",
},
{
"fields": {
"customer": "Brown",
"date": 1157878800,
"item": "Exhaust valve",
"price": "1440",
"tax": "0.12",
},
"put": "id:purchase:purchase::11",
},
{
"fields": {
"customer": "Brown",
"date": 1157882400,
"item": "Rocker arm",
"price": "2330",
"tax": "0.24",
},
"put": "id:purchase:purchase::12",
},
{
"fields": {
"customer": "Brown",
"date": 1157875200,
"item": "Spring",
"price": "3770",
"tax": "0.12",
},
"put": "id:purchase:purchase::13",
},
{
"fields": {
"customer": "Smith",
"date": 1157878800,
"item": "Spark plug",
"price": "6100",
"tax": "0.24",
},
"put": "id:purchase:purchase::14",
},
{
"fields": {
"customer": "Jones",
"date": 1157968800,
"item": "Exhaust port",
"price": "9870",
"tax": "0.12",
},
"put": "id:purchase:purchase::15",
},
{
"fields": {
"customer": "Brown",
"date": 1157961600,
"item": "Piston",
"price": "1597",
"tax": "0.24",
},
"put": "id:purchase:purchase::16",
},
{
"fields": {
"customer": "Smith",
"date": 1157965200,
"item": "Connection rod",
"price": "2584",
"tax": "0.12",
},
"put": "id:purchase:purchase::17",
},
{
"fields": {
"customer": "Jones",
"date": 1157968800,
"item": "Rod bearing",
"price": "4181",
"tax": "0.24",
},
"put": "id:purchase:purchase::18",
},
{
"fields": {
"customer": "Jones",
"date": 1157972400,
"item": "Crankshaft",
"price": "6765",
"tax": "0.12",
},
"put": "id:purchase:purchase::19",
},
]
docs = [
{"fields": doc["fields"], "id": doc["put"].split("::")[-1]}
for doc in sample_data
]
return docs

def feed_grouping_data(self) -> None:
# Feed documents
self.app.feed_iterable(iter=self.sample_grouping_data, schema="purchase")
return None

def test_dotproduct_with_annotations(self):
# Feed a document with 'weightedset_field'
field = "weightedset_field"
Expand Down

0 comments on commit 119337c

Please sign in to comment.